1
0
Fork 0
tractor/tractor
Tyler Goodlet c5c3f7e789 Use `tractor.Context` throughout the runtime core
Instead of tracking feeder mem chans per RPC dialog, store `Context`
instances which (now) hold refs to the underlying RPC-task feeder chans
and track them inside a `Actor._contexts` map. This begins a transition
to making the "context" idea the primitive abstraction for representing
messaging dialogs between tasks in different memory domains (i.e.
usually separate processes).

A slew of changes made this possible:
- change `Actor.get_memchans()` -> `.get_context()`.
- Add new `Context._send_chan` and `._recv_chan` vars.
- implicitly create a new context on every `Actor.send_cmd()` call.
- use the context created by `.send_cmd()` in `Portal.open_context()`
  instead of manually creating one.
- call `Actor.get_context()` inside tasks run from `._invoke()`
  such that feeder chans are implicitly created for callee tasks
  thus fixing the bug #265.

NB: We might change some of the internal semantics to do with *when* the
feeder chans are actually created to denote whether or not a far end
task is actually *read to receive* messages. For example, in the cases
where it **never** will be ready to receive messages (one-way streaming,
a context that never opens a stream, etc.) we will likely want some kind
of error or at least warning to the caller that messages can't be sent
(yet).
2021-12-03 14:49:55 -05:00
..
testing Drop trailing comma 2021-07-06 08:23:29 -04:00
trionics Change to `gather_contexts()`, use event for graceful exit 2021-10-24 14:00:01 -04:00
__init__.py Add 'open_actor_cluster' to __all__ 2021-10-23 16:17:29 -04:00
_actor.py Use `tractor.Context` throughout the runtime core 2021-12-03 14:49:55 -05:00
_child.py Docstring to the top\!, and redundant spaces goodbye\! 2020-07-29 15:39:38 -03:00
_clustering.py Make auto generated child names <parent_name>.<name> 2021-11-02 15:40:15 -04:00
_debug.py Fix missing yield in lock acquirer 2021-11-07 23:48:05 -05:00
_discovery.py Remove union type for root getter 2021-10-14 13:39:46 -04:00
_entry.py Try not masking SIGINT in child processes 2021-09-02 16:22:59 -04:00
_exceptions.py Hide `_invoke()` tb, move actor error to exceptions mod 2021-07-31 13:56:26 -04:00
_forkserver_override.py Ignore type checks on stdlib overrides 2021-02-21 14:08:23 -05:00
_ipc.py Appease mypy 2021-12-02 15:29:04 -05:00
_mp_fixup_main.py Fix more stdlib typing issues with latest mypy 2021-02-21 12:48:03 -05:00
_portal.py Use `tractor.Context` throughout the runtime core 2021-12-03 14:49:55 -05:00
_root.py De-noise warnings, add a 'cancel' log level 2021-10-06 17:02:13 -04:00
_spawn.py Don't cancel receive streams inside `.cancel_actor()` 2021-12-02 15:29:04 -05:00
_state.py Add a no runtime error 2021-04-28 12:23:08 -04:00
_streaming.py Use `tractor.Context` throughout the runtime core 2021-12-03 14:49:55 -05:00
_supervise.py Add a nursery "exited" signal 2021-12-02 08:18:04 -05:00
log.py De-noise warnings, add a 'cancel' log level 2021-10-06 17:02:13 -04:00
msg.py Adjustments for non-frozen context dataclass change 2021-07-06 08:23:29 -04:00