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
Once #181 lands and all dependent projects are ported, we can safely move to the new trio.run() based entry api.
The ideal user facing API instead looks like:
importtrioimporttractorasyncdefmain():
# actor runtime is started implicitly inside the first used nursery if this actor is the rootasyncwithtractor.open_nursery() asn:
portal=awaitn.run_in_actor(trio.sleep(1))
trio.run(main)
or, if the user wants to start up the actor runtime / tree manually:
importtrioimporttractorasyncdefmain():
# this starts up the IPC / channel machinery without having to open an actor nursery.# you could also just open an actor nursery and sleep in it's body I guess?asyncwithtractor.open_root_actor() asactor:
# run a top level root actor and that's it.awaittrio.sleep_forever()
trio.run(main)
This is of course all up for discussion.
I'm prone to maybe offer a tractor.lowlevel (like trio) for stuff like this open_root_actor().
Luckily since most of our docs reference examples, one those are changed there should be little work to do on that front.
The text was updated successfully, but these errors were encountered:
Once #181 lands and all dependent projects are ported, we can safely move to the new
trio.run()
based entry api.The ideal user facing API instead looks like:
or, if the user wants to start up the actor runtime / tree manually:
This is of course all up for discussion.
I'm prone to maybe offer a
tractor.lowlevel
(liketrio
) for stuff like thisopen_root_actor()
.Luckily since most of our docs reference examples, one those are changed there should be little work to do on that front.
The text was updated successfully, but these errors were encountered: