[erlang-questions] State in webmachine

André Graf andre@REDACTED
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
> correct?
> How would you do it in easy way?
> The hard way I know is to spawn process that will keep my data.
> Best regards,
> Max
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions

More information about the erlang-questions mailing list