[erlang-questions] How to force kernel application will always be started before my app

Vlad Dumitrescu vladdu55@REDACTED
Tue Nov 25 22:34:12 CET 2008

On Tue, Nov 25, 2008 at 22:10, Richard Carlsson <richardc@REDACTED> wrote:
> mats cronqvist wrote:
>> Richard Carlsson <richardc@REDACTED> writes:
>>> What we're talking about would be a gen_event server that publishes
>>> relatively rarely occurring events.
>>   enhancing erlang:system_monitor/2 might be a better solution.
> I don't think it has the right structure for that. It is very
> much tied to the runtime system internals, so it will be hard
> (and rather unnatural) to publish software events like server
> start/stop through it. Likewise, it would be hard to extend its
> functionality so that it behaves like a gen_event server with
> multiple subscribers that come and go. (And it might even cause
> so much traffic that I'm not quite sure its events should be
> broadcast through our hypothetical system event server. Perhaps
> a subset of them?)

It feels like Mats is right and system_monitor could be a single API
for all these notifications. Whether the implementation asks the
runtime or sends the request to some server, that is a detail of no
interest for the users. I think it's easier to have a single place
where one has to look. It would be confusing to have to keep track
that interest in event X has to be registered by calling function
M1:F1, while event Y is accessed via M2:F2 and so on.

We could even have an API for anyone to register their own event
sources, so that the framework is all generic and system_monitor
becomes just a dispatcher.

best regards,

More information about the erlang-questions mailing list