If I recall correctly, handle_function is called from multiple processes
so that a server can handle multiple requests at once. Therefore, it is
not really possible to maintain a single state between calls.
--David
Brian McKinney wrote:
> Currently, the callback for the handler under Erlang is defined as follows;
>
> handle_function(Function, Args)
>
> It would be nice to propagate state between calls so I could collect metrics
> and pass in config information. There are other ways to do this like
> wrapping the handler in a gen_server but it would be very convenient (and
> simplify things greatly) if the semantics of handle_function are changed to:
>
> handle_function(Function, Args, State) ->
> {ok, State} | {reply, Reply, State}
>
> Cheers,
>
> Brian McKinney