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

Support Multiple Worker Types #27

Open
robertomiranda opened this issue Oct 2, 2015 · 1 comment
Open

Support Multiple Worker Types #27

robertomiranda opened this issue Oct 2, 2015 · 1 comment

Comments

@robertomiranda
Copy link

I was wondering if with the current API is possible to add more Worker with different type to an existing Server? If this is not possible what do you think about the following chunk of code?

se = ServerEngine.create(nil, MyWorker1, {
  daemonize: true,
  log: 'myserver.log',
  pid_path: 'myserver.pid',
  worker_type: 'process',
  workers: 2,
})

se.add_worker(MyWorker2)
se.add_worker(MyWorker2)
se.add_worker(MyWorker2)
se.run

This code launch workers like show the next diagram:

                              +---------+
                   +----------+MyWorker1|
                   |          +---------+
                   |                     
                   |          +---------+
                   |   +------+MyWorker1|
                   |   |      +---------+
+---------+     +--+---+                 
|Superviso+-----+Server+----------------+
+---------+     +-+----+      |MyWorker2|
                  |    |      +---------+
                  |    |                 
                  |    |      +---------+
                  |    +------+MyWorker2|
                  |           +---------+
                  |                      
                  |           +---------+
                  +-----------+MyWorker2|
                              +---------+

@robertomiranda
Copy link
Author

cc @frsyuki

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