Closed chouzar closed 1 month ago
A previous attempt at solving this was to do a cleanup after a condition met. Needed to keep track of the actor itself self
and a copy of the actor's selector or monitors in state:
type State(msg, tag, group) {
State(
self: Registry(msg, tag, group),
selector: process.Selector(Message(msg, tag, group)),
monitors: set.Set(process.ProcessMonitor)
)
Then when a threshold is reached, send a Cleanup
message to self so that we can rebuild the selector with the current stored monitors.
We may use this type to re-build a selector:
type State(msg, tag, group) {
State(
// This keeps track of registered subjects and where to look for them on de-registration.
registration: Dict(process.Pid, set.Set(Registrant(msg, tag, group)))
)
}
This was solved in 4dccee8c4b858f03da41c142a3ae881f82cd43fa
The selector growing didn't turn out to be a big issue: