lasp_pg
lasp_pg copied to clipboard
Communicating with PID
Hey guys just familiarizing myself with what you're doing. Pretty cool stuff. I do have a question about the process group. When I get the members of a group, how am I supposed to communicate with them? Since Partisan circumvents traditional erlang clustering am I supposed to communicate through that?
For now, I would use the messaging API documented here.
For the future, we're planning on adding {via, _, _} support soon, and then you'll be able to use the normal messaging facilities.
cc: @evanmcc
@cmeiklejohn but then you need to know the node that the pid resides at right?
I'm sorry if I completely misunderstood your answer.
Yes, that's correct, but a pid knows the node it's contained on -- it's encoded in it's process identifier.
node(Pid)
Got it! Thanks @cmeiklejohn! Ultimately using {via, _, _} would be perfect. Thanks for the quick reply 👍
Yes, that's what we're aiming for, but we need someone to complete the implementation of it.
most of the stuff that I have done is pretty rough, but the heart of it is here: https://github.com/SpaceTime-IoT/vonnegut/compare/partisan-messaging?expand=1#diff-71b6e99f98289c8f3cc76cabea289321
this relies on a branch of partisan, but it should be clear enough. the current forward API just does casts right now, but it doesn't look amazingly difficult to add the rest. See https://github.com/lasp-lang/partisan/issues/42 and related issues for the discussion surrounding the various implementation issues.
Didn't know about node(Pid) thanks!