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
actor: move more port receiver supervision to rust (#578)
Summary:
Pull Request resolved: #578
this diff moves supervision logic from python into rust, aligning with the goal of eliminating complex supervision wiring in python.
the essential change is that:
```
class ActorEndpoint(...):
def _port(self, once: bool = False) -> "PortTuple[R]":
monitor = (
None
if self._actor_mesh._actor_mesh is None
else self._actor_mesh._actor_mesh.monitor()
)
return PortTuple.create(self._mailbox, monitor, once)
```
becomes:
```
class ActorEndpoint(...):
def _port(self, once: bool = False) -> PortTuple[R]:
p, r = PortTuple.create(self._mailbox, once)
return PortTuple(p, PortReceiver(self._mailbox, self._supervise(r._receiver)))
```
`_supervise(...)` dispatches to new Rust helpers:
```python
mesh.supervise_port(...) and mesh.supervise_once_port(...)
```
which wrap the receivers with supervision logic (including selection between message arrival and supervision events), completely eliminating the need for python-side constructs like `ActorMeshMonitor`.
most of the python complexity introduced in D77434080 is removed. the only meaningful addition is `_supervise(...)`, a small overrideable hook that defaults to a no-op and cleanly delegates to rust when supervision is desired.
- the creation and wiring of the monitor stream is now fully in rust.
- the responsibility of wrapping receivers with supervision is now fully in rust.
- python no longer constructs or passes supervision monitors; rust now owns the full wiring, and python receives already-wrapped receivers with supervision behavior embedded
this is a strict improvement: lower complexity, cleaner override points and supervision is entirely managed in rust.
Differential Revision: D78528860
0 commit comments