[erlang-questions] It would be nice if one could attach a "context" value to a monitor, so you get that value back when/if the monitor is trigged

Christian S chsu79@REDACTED
Thu Aug 21 10:42:43 CEST 2008


> Also, you already have the quite specific "ref" associated with the
> monitor, which you could use as a key in a dict or ets table for the
> extra information. Or combine the two ideas, having a single process
> that hides the refs, the 'DOWN' messages, and the table, acting as a
> "user-friendly monitor service".

Mapping monitor references to context value is the obvious way, I do
it over and over again and want to avoid repeating it.  Having a
single monitor service process might be worthwhile, but it smells like
premature optimization compared to a process for each monitor. I'll
keep it in mind though, since it would be a reusable component.



More information about the erlang-questions mailing list