From 8a995beb6a592990e6a077de65cb61f6e775cc47 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Sat, 8 Aug 2020 22:29:57 -0400 Subject: [PATCH] Docs fixes --- tractor/msg.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tractor/msg.py b/tractor/msg.py index cd064a0..41d1d6b 100644 --- a/tractor/msg.py +++ b/tractor/msg.py @@ -143,7 +143,7 @@ def pub( - packetizer: ``Callable[[str, Any], Any]`` a callback who receives the topic and value from the publisher function each ``yield`` such that 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: @@ -161,7 +161,7 @@ def pub( task_name='source1', ) ) - async for value in portal.result(): + async for value in await portal.result(): print(f"Subscriber received {value}") @@ -264,4 +264,5 @@ def pub( # ``wrapt.decorator`` doesn't seem to want to play nice with its # whole "adapter" thing... wrapped._tractor_stream_function = True # type: ignore + return wrapper(wrapped)