[erlang-questions] supervisor_bridge enhancement

Serge Aleynikov saleyn@REDACTED
Sat May 24 17:41:19 CEST 2008


Currently the supervisor_bridge behavior doesn't expose 
Mod:handle_call/3 and Mod:handle_info/3 callbacks.  When using this 
behavior to provide custom startup for some application's server (such 
as inets' httpd) I frequently find it lacking the ability to report a 
Pid of the bridged child or provide handling of custom messages.

Attached is a prototype of supervisor_bridge extension that adds a new 
function get_child_pid/1, as well as new callbacks Mod:handle_call/3, 
Mod:handle_cast/2, and handle_info/2.

Some possible applications of this module could be to implement:
a. timed instantiation of the bridged Pid (e.g. run the bridged module 
only between certain hours of a day).
b. registration of the bridged Pid of a 3rd party server (if it doesn't 
register itself).

It would be nice if this supervisor_bridge extension could make it to 
the distribution.

Serge
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sup_bridge.erl
Type: text/x-erlang
Size: 6228 bytes
Desc: not available
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20080524/636b0944/attachment.bin>


More information about the erlang-questions mailing list