Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any chance you could update the README? #22

Open
sbowman opened this issue Oct 28, 2012 · 0 comments
Open

Any chance you could update the README? #22

sbowman opened this issue Oct 28, 2012 · 0 comments

Comments

@sbowman
Copy link

sbowman commented Oct 28, 2012

Could you possibly go back and update the README so that the example code is complete and it works? Most of the code samples generate errors, and for the life of me I can't get the sample "echo" client to work quite right.

For example, this client-side code definitely doesn't work for echo:

  val node = Node("remote", "cookie")
  node.spawn { mbox =>
    mbox.send(('kharon, Symbol("kharon@hypatia")), mbox.self, (mbox.self, "Hello!"))
    val received = mbox.receive
    println("Received = " + received)
  }

The server-side gets the message and returns a response, but the client never gets it.

This revision to the above, however, does work:

  val node = Node("remote", "cookie")
  val mbox = node.spawnMbox
  mbox.send(('kharon, Symbol("kharon@hypatia")), mbox.self, (mbox.self, "Hello!"))
  val received = mbox.receive
  println("Received " + received)

But in both cases, the code hangs due to what I can only guess is a thread running in the background that isn't being cleaned up. I've tried this:

  node.shutdown
  println("Shutdown")

The "Shutdown" is output, but it doesn't really stop the node. Is there an example for how you stop a node just making a quick remote call for information?

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant