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

Allow registration of threads with Pids #1

Closed
andrewjstone opened this issue Aug 30, 2016 · 1 comment
Closed

Allow registration of threads with Pids #1

andrewjstone opened this issue Aug 30, 2016 · 1 comment

Comments

@andrewjstone
Copy link
Owner

andrewjstone commented Aug 30, 2016

System threads, such as server endpoints, filesystems etc... need a way to receive messages from processes. For instance, an API server receives a message, unmarshals it, creates an internal message, and sends it to the pid responsible. When the pid needs to reply with the message it needs a way to send it back to the API server so it can marshal a reply and send it to the client.

There are two ways to do this:

  1. Hardcode the receivers in the processes and have them do the send on the channel directly
  2. Register a sender keyed by Pid with the executor. Then return the reply to be sent from the pid just as with other envelopes.

We choose #2 since it enables easier testing and continues to not allow side effects outside the process.

For system thread PIDs I think we should make them part of the 'system' group in the Pid group field. This way the senders can be easily found by looking them up in a HashMap and also prevent the lookup of non system pids for normal envelope sending.

@andrewjstone
Copy link
Owner Author

Fixed by #3

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