Skip to content

Conversation

@matyasmarkovics
Copy link

Remote Workers

I needed to create a pool of processes similar to the rpc module implementation in Erlang/OTP. - rpc (or rex) is a single process, I needed a pool of them. - This led me to extend poolboy, so that (local) workers could be started by a supervisor on a remote node.

For this to work these are the necessary steps:

  1. Find the Pid of the Worker-Supervisor, even if remote, see find_pid/1
  2. Start the workers via their Supervisor, even if Supervisor is remote, see new_worker/2
  3. Monitor Worker-Supervisors, that were passed in and stop if they go DOWN
  4. Monitor Remote node if Worker-Supervisor is remote and stop on nodedown
  5. Stop Worker-Supervisor using gen_server:stop/1, so that it works remotely too. See: stop_supervisor/2

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

Successfully merging this pull request may close these issues.

1 participant