[erlang-questions] State in webmachine
Fri Feb 10 09:48:09 CET 2012
As far as I understand in webmachine the state (they call it context) is
only passed among the different webmachine resource functions e.g. you
build up your state in the init/1 function, which you can later use in
e.g. process_post. Once the request is handled the state is destroyed,
as it makes sense for a stateless protocol such as http. If you really
need shared state I would suggest to use a process holding your state or
just take an ets table.
Am 10.02.12 08:30, schrieb Max Bourinov:
> I would like to keep time of last call inside page module. I suspect
> that State which exists in the page module can help me with it - is it
> How would you do it in easy way?
> The hard way I know is to spawn process that will keep my data.
> Best regards,
> erlang-questions mailing list
More information about the erlang-questions