Docs fixes

dereg_on_channel_aclose
Tyler Goodlet 2020-08-08 22:29:57 -04:00
parent 292513b353
commit 8a995beb6a
1 changed files with 3 additions and 2 deletions

View File

@ -143,7 +143,7 @@ def pub(
- packetizer: ``Callable[[str, Any], Any]`` a callback who receives - packetizer: ``Callable[[str, Any], Any]`` a callback who receives
the topic and value from the publisher function each ``yield`` such that the topic and value from the publisher function each ``yield`` such that
whatever is returned is sent as the published value to subscribers of whatever is returned is sent as the published value to subscribers of
that topic. By default this is a dict ``{topic: value}``. that topic. By default this is a dict ``{topic: str: value: Any}``.
As an example, to make a subscriber call the above function: As an example, to make a subscriber call the above function:
@ -161,7 +161,7 @@ def pub(
task_name='source1', task_name='source1',
) )
) )
async for value in portal.result(): async for value in await portal.result():
print(f"Subscriber received {value}") print(f"Subscriber received {value}")
@ -264,4 +264,5 @@ def pub(
# ``wrapt.decorator`` doesn't seem to want to play nice with its # ``wrapt.decorator`` doesn't seem to want to play nice with its
# whole "adapter" thing... # whole "adapter" thing...
wrapped._tractor_stream_function = True # type: ignore wrapped._tractor_stream_function = True # type: ignore
return wrapper(wrapped) return wrapper(wrapped)