You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With the completion of #121 we now have a way to wrangle asyncio code
from SC-actor-land.
One of the obvious ugly parts of the current api is the delivery of an asyncio.Queue to the target asyncio task. In keeping with trio
style it would be much better to offer a small abstraction much like trio.abc.Channel to make asyncio-side streaming semantics more
elegant.
We already introduced a LinkedTaskChannel as part of #121
for the trio side and it would be handy to have something equivalent
for asyncio tasks.
Some design options:
make two types of LinkedTaskChannels, one for each task in each loop
probably allows the most flexibility for the apis allowed from either task and is most explicit type-wise?
we could adopt a stapeled stream style where we dynamically figure out which loop the channel object is being used in and then runtime-define the methods implementations? This might allow for a more symmetric channel api/object at the expense of some magical method definitions?
consider adding a .started() method to whatever the asyncio-side channel type ends up being much like the anyio.from_thread.BlockingPortal.start_task()/trio.Nursery.start() target function mechanisms. This would allow us to avoid the current manual first-sent-value-ublocks-the-trio side to_asyncio.open_channel_from() entry.
Very open to and interested in other ideas (and further discussion) from the lurkerz.
The text was updated successfully, but these errors were encountered:
With the completion of #121 we now have a way to wrangle
asyncio
codefrom SC-actor-land.
One of the obvious ugly parts of the current api is the delivery of an
asyncio.Queue
to the targetasyncio
task. In keeping withtrio
style it would be much better to offer a small abstraction much like
trio.abc.Channel
to makeasyncio
-side streaming semantics moreelegant.
We already introduced a
LinkedTaskChannel
as part of #121for the
trio
side and it would be handy to have something equivalentfor
asyncio
tasks.Some design options:
LinkedTaskChannel
s, one for each task in each looptrio
peeps:anyio
?.started()
method to whatever theasyncio
-side channel type ends up being much like theanyio.from_thread.BlockingPortal.start_task()
/trio.Nursery.start()
target function mechanisms. This would allow us to avoid the current manual first-sent-value-ublocks-the-trio
sideto_asyncio.open_channel_from()
entry.Very open to and interested in other ideas (and further discussion) from the lurkerz.
The text was updated successfully, but these errors were encountered: