[erlang-questions] Erlang-based opensource publish-subscribe servers

Ulf Wiger <>
Sun Oct 24 19:40:07 CEST 2010


Hi Zvi,

One way to implement publish/subscribe is with gproc properties.


-define(KEY, {?MODULE, subscr}).

subscribe() ->
    gproc:add_local_property(?KEY, undefined).

publish(Event) ->
    [P ! {self(), ?KEY, Event} || {P,_} <- gproc:lookup_local_properties(?KEY)].


Gproc takes care of monitoring the subscribers. Change local to global
for global publish/subscribe.

http://github.com/esl/gproc

BR,
Ulf W

On 24 Oct 2010, at 19:10, Zvi wrote:

> Hi,
> 
> I looking for the opensource examples of Erlang-based publish-
> subscribe servers.
> Any suggestions?
> 
> Thanks in advance,
> Zvi
> 
> ________________________________________________________________
> erlang-questions (at) erlang.org mailing list.
> See http://www.erlang.org/faq.html
> To unsubscribe; mailto:
> 

Ulf Wiger, CTO, Erlang Solutions, Ltd.
http://erlang-solutions.com





More information about the erlang-questions mailing list