What alternatives are available after the removal of the monitor
API?
#307
-
@slawlor Previously, you described Ractor as "A pure-Rust actor framework inspired by Erlang's Similar breaking changes occurred in Typical use cases for the
In all these scenarios, the core idea is the same: a "manager" actor monitors a "worker" actor, receiving So, is the |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Hello! Yes, the monitor API was deprecated in 0.11 due to excessive memory allocation use with each instantiated actor. It's possible we could add it back under a feature gate, which would allow people to opt-in to the functionality if necessary. From users, we also had no reported usage of the API, so it was debatable the value it brought in the system which also contributed to the deprecation. If you want, you can pretty trivially add it back by undoing what the removal PR did, and gate the struct fields and associated methods with a feature. I don't think I'll have time to do it immediately, but we did have enough test coverage that was originally removed, so undoing the removal and adding a feature is an easy thing for a new comer to take on if you're willing! Personally, and from production experience, I don't think it's necessary to make it a hard feature of every actor without specifically opting in. From your own examples, I would personally choose direct supervision vs monitoring in actor management. The main reason being, monitoring is only possible post-spawning an actor, meaning you race with the capture functionality on the actor's I do see some value, and possibly clearer patterns, in your examples so I agree there's value in adding the API back, but it's also a tradeoff in functionality performance (unless we maybe store the functionality as a |
Beta Was this translation helpful? Give feedback.
-
For reference, it was dropped specifically in PR #260 |
Beta Was this translation helpful? Give feedback.
-
I had a chance to address this functionality gap and added it back in #317. However due to the memory regression it introduces, for now it's gated behind a feature ( |
Beta Was this translation helpful? Give feedback.
I had a chance to address this functionality gap and added it back in #317. However due to the memory regression it introduces, for now it's gated behind a feature (
monitors
). It will be included in v0.14.4