Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to pass a digraph to a different process and node?
    text
    copied!<p>I have created a <a href="http://www.erlang.org/doc/man/digraph.html#add_vertex-2" rel="nofollow noreferrer"><strong>digraph</strong></a> term on process A and I want to pass this digraph to a process on another node. Whenever I use this digraph on the other process I am getting errors such as:</p> <pre><code>** {badarg, [{ets,insert,[598105,{"EPqzYxiM9UV0pplPTRg8vX28h",[]}],[]}, {digraph,do_add_vertex,2,[{file,"digraph.erl"},{line,377}]}, </code></pre> <p>Becasuse a <strong>digraph</strong> is based on ETS, it appears that this is quite more complicated, making a digraph pretty much standalone on the process it was created. I have found this entry that reveals a similar problem : <a href="https://stackoverflow.com/questions/5448803/unable-to-use-erlang-ets-in-receive-block">ETS on a different process</a></p> <p>I know I can create the digraph in a <strong>server</strong> an then connect to it through otp messages, but I cannot do that in my architecture. All nodes can communicate using a specific approach designed to pass the state along as Terms. </p> <p>It appears to me that having digraphs sent accross different nodes that cannot directly communicate with each other is not possible. Overall, <strong>it appears that a digraph cannot be directly serialized</strong>. I am thinking that I can "unwind" the digraph as a list of vertices and edges and then transmit and recreate it on the other process (not efficient, performing or elegant). Any thoughts on a better way to <strong>serialize</strong> it ? Is there a way to serialize the digraph state out of the ETS store ?</p> <p>Any thoughts ?</p>
 

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