Flip travis badge to new username
parent
de8d69c58b
commit
4b825778dd
12
README.rst
12
README.rst
|
@ -5,8 +5,8 @@ An async-native "`actor model`_" built on trio_ and multiprocessing_.
|
||||||
|
|
||||||
|travis|
|
|travis|
|
||||||
|
|
||||||
.. |travis| image:: https://img.shields.io/travis/tgoodlet/tractor/master.svg
|
.. |travis| image:: https://img.shields.io/travis/goodboy/tractor/master.svg
|
||||||
:target: https://travis-ci.org/tgoodlet/tractor
|
:target: https://travis-ci.org/goodboy/tractor
|
||||||
|
|
||||||
.. _actor model: https://en.wikipedia.org/wiki/Actor_model
|
.. _actor model: https://en.wikipedia.org/wiki/Actor_model
|
||||||
.. _trio: https://github.com/python-trio/trio
|
.. _trio: https://github.com/python-trio/trio
|
||||||
|
@ -608,7 +608,7 @@ function:
|
||||||
|
|
||||||
.. code:: python
|
.. code:: python
|
||||||
|
|
||||||
async def streamer(ctx, rate=2):
|
async def streamer(ctx: tractor.Context, rate: int = 2) -> None:
|
||||||
"""A simple web response streaming server.
|
"""A simple web response streaming server.
|
||||||
"""
|
"""
|
||||||
while True:
|
while True:
|
||||||
|
@ -628,7 +628,7 @@ multiple tasks streaming responses concurrently:
|
||||||
|
|
||||||
.. code:: python
|
.. code:: python
|
||||||
|
|
||||||
async def streamer(ctx, url, rate=2):
|
async def streamer(ctx: tractor.Context, rate: int = 2) -> None:
|
||||||
"""A simple web response streaming server.
|
"""A simple web response streaming server.
|
||||||
"""
|
"""
|
||||||
while True:
|
while True:
|
||||||
|
@ -640,7 +640,9 @@ multiple tasks streaming responses concurrently:
|
||||||
await trio.sleep(1 / rate)
|
await trio.sleep(1 / rate)
|
||||||
|
|
||||||
|
|
||||||
async def stream_multiple_sources(ctx, sources):
|
async def stream_multiple_sources(
|
||||||
|
ctx: tractor.Context, sources: List[str]
|
||||||
|
) -> None:
|
||||||
async with trio.open_nursery() as n:
|
async with trio.open_nursery() as n:
|
||||||
for url in sources:
|
for url in sources:
|
||||||
n.start_soon(streamer, ctx, url)
|
n.start_soon(streamer, ctx, url)
|
||||||
|
|
Loading…
Reference in New Issue