lasp_pg icon indicating copy to clipboard operation
lasp_pg copied to clipboard

Communicating with PID

Open thdxr opened this issue 8 years ago • 8 comments
trafficstars

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?

thdxr avatar May 11 '17 00:05 thdxr

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.

cmeiklejohn avatar May 15 '17 20:05 cmeiklejohn

cc: @evanmcc

cmeiklejohn avatar May 15 '17 20:05 cmeiklejohn

@cmeiklejohn but then you need to know the node that the pid resides at right?

I'm sorry if I completely misunderstood your answer.

edgurgel avatar May 15 '17 20:05 edgurgel

Yes, that's correct, but a pid knows the node it's contained on -- it's encoded in it's process identifier.

node(Pid)

cmeiklejohn avatar May 15 '17 20:05 cmeiklejohn

Got it! Thanks @cmeiklejohn! Ultimately using {via, _, _} would be perfect. Thanks for the quick reply 👍

edgurgel avatar May 15 '17 20:05 edgurgel

Yes, that's what we're aiming for, but we need someone to complete the implementation of it.

cmeiklejohn avatar May 15 '17 21:05 cmeiklejohn

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.

evanmcc avatar May 15 '17 21:05 evanmcc

Didn't know about node(Pid) thanks!

thdxr avatar May 15 '17 21:05 thdxr