[erlang-questions] Is there a way to serialise a running process & resume it later (i.e. continuations)

Pablo Polvorin pablo.polvorin@REDACTED
Thu Feb 26 22:52:24 CET 2009


> Sorry, I don't understand why you want to store a running process. Why not
> just leave the process and use it when needed?
>
> Robert
>

I think he refers to the ability to return to a previous state of the
computation.
Using a gen_fsm isn't enough by itself:  you can easily instruct the
fsm to return from the fsm_state_3 back to fsm_state_2, but you will
also need to discard any changes you did in the process state during
the original transition from fsm_state_2 to fsm_state_3.
I think, however, that shouldn't be too difficult to come with a
custom solution, or even a custom behaviour for that, by keeping track
of the previous process data,  or implementing "undo"s for each
possible type of action (something like the common undo-redo pattern
for editors)



More information about the erlang-questions mailing list