[erlang-questions] Associating contextual info with monitors
Mon Feb 18 09:59:12 CET 2008
On 18/02/2008, Dave Smith <dizzyd@REDACTED> wrote:
> On several occasions, I've found myself wanting to be able to do some
> cleanup (e.g. remove an entry in ets) when a process dies.
I suppose that's the right way to do it - it was quite a recurring
pattern during the Erlang project I undertook last year (for what
that's worth). Being able to associate extra data with a monitor would
have made this extra functionality obsolete.
The state associated with the monitored processes was always in the
domain of the monitoring behaviour (e.g. connections per ip address)
however. Which meant that in many cases you actually wanted to have
access to this information for other reasons than cleaning up. So
either there needs to be a possibility to read the extra data from a
monitor or you keep just another state term in your process.
Best regards from Berlin,
More information about the erlang-questions