gen_server Question

Behdad Forghani <>
Sun Aug 1 02:08:09 CEST 2010


Hello,

 

I am writing a module that mostly monitors a directory at certain intervals
and processes the files that are dropped into that directory and sends
messages to another process. I want this processes to be supervised. Two
options come into my mind:

 

1 - Write a server myself, similar to server4.erl in Joe Armstrong's
"Programming Erlang" book. In this case, I will use an "after Time ->"
clause.

2 - Use gen_server behavior and use timer module to send messages to myself,
since, I do not see any other way to get regular timeouts.

 

My question is, shall I try to use gen_server? Do I get anything extra by
using gen_server? I do not need multicall and I can write my own terminate
routine. Is there anything else that I will be missing?

 

Thanks in advance.

Behdad

 



More information about the erlang-questions mailing list