Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>AFAIK there's no way to transfer a process between erlang nodes and I can think about many reasons to forbid this, between the others you may mess with internal nodes memory, simply consider a process which holds data (other than in the internal 'State' loop parameter) in process dictionary (process heap), binary (different garbage collection method).</p> <p>One workaround could be to provide the gen_fsm/gen_server with a method that can spawn a new process recreating at the same time the internal state of the server/state machine. I think it's more difficult to say that to implement, you could simply use two start functions:</p> <ul> <li>one that initializes the behaviour (like I think you're doing right now)</li> <li>one that takes also a node and start through remote method call the server on that node and initializes state (by init/1 function or in an explicite way by sending a message, i.e. the state of the server)</li> </ul> <p>But I must say that I see two main problems here:</p> <ul> <li>Synchronization: one needs to make sure the process: start server on remote node -> set remote server state -> kill current local server is atomic</li> <li>Coherence: other processes referring to local one must switch their reference to the remote one</li> </ul> <p>The former could be resolved in many ways (my two cents: explicit message passing between local and remote server - overhead but bulletproof considering Erlang runtime system), the latter could be resolved with monitor/links and exit return values (the remote server pid) or in a more elegant way with a publish/subscribe model with a gen_event process.</p> <p>I hope you find this useful to resolve your issue and ask anything if you need!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload