-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Heh, yeah I guess tractor.run() is kinda dumb.. #177
Comments
IMHO the ideal API would be: async with tractor.open_actor_nursery() as n:
n.start_soon(async_fn) And tractor should take care of any global bookkeeping internally, if there is such a thing. $0.02 :) |
@richardsheridan only problem is there might only ever be one "actor_nursery* open per program. Also note, in current parlance, an maybe |
Hmm thinking more on this I wonder if we can just do implicit runtime startup (only in the root process) on the first entry to I'm thinking there should still be an explicit |
This begins the move to dropping support for `tractor.run()` which we don't really need since the runtime is started (as it always has been) from a new sub-task / nursery. Instead this introduces starting the actor tree through a `open_root_actor()` async context manager which we'll likely implicitly call (from the root) on the first use of an actor nursery. Drop `_actor._start_actor()` and factor its contents into this new api. Make `run()` and `run_daemon()` use `open_root_actor()` until we decide to remove them. Relates to #168 and #177
The removal of
|
This begins the move to dropping support for `tractor.run()` which we don't really need since the runtime is started (as it always has been) from a new sub-task / nursery. Instead this introduces starting the actor tree through a `open_root_actor()` async context manager which we'll likely implicitly call (from the root) on the first use of an actor nursery. Drop `_actor._start_actor()` and factor its contents into this new api. Make `run()` and `run_daemon()` use `open_root_actor()` until we decide to remove them. Relates to #168 and #177
This begins the move to dropping support for `tractor.run()` which we don't really need since the runtime is started (as it always has been) from a new sub-task / nursery. Instead this introduces starting the actor tree through a `open_root_actor()` async context manager which we'll likely implicitly call (from the root) on the first use of an actor nursery. Drop `_actor._start_actor()` and factor its contents into this new api. Make `run()` and `run_daemon()` use `open_root_actor()` until we decide to remove them. Relates to #168 and #177
Resolved with #197. |
This is somewhat of a 🤦🏼 and directly related to #168.
Thanks to the
trio
crowd for pointing out that we can probably just make ourselves a:Some benefits to this:
trio.run()
🤯debug_mode=True
?trio.run()
when we really have no reason toSome worries:
.open_root_runtime()
which can only be called once per program?Is there a better name?
.open_root()
.start_runtime()
start_root()
Lurkerzzzz!!!
The text was updated successfully, but these errors were encountered: