circus-tent / circus

A Process & Socket Manager built with zmq
http://circus.readthedocs.org/
Other
1.55k stars 258 forks source link

add new sockets commands #176

Open tarekziade opened 12 years ago

tarekziade commented 12 years ago

not sure what to do on the watchers that 'use sockets' - maybe a watcher should tell precisely the socket it uses, so we can coordinate its start/stop with the socket start stop

Natim commented 12 years ago

Actually there should be only one watcher bind to a socket so IMHO the watcher management should also make the socket management.

tarekziade commented 12 years ago

the same socket can be used by two watchers

Natim commented 12 years ago

Ok what about something like that:

[circus]
check_delay = 5
endpoint = tcp://127.0.0.1:5555
pubsub_endpoint = tcp://127.0.0.1:5556
stats_endpoint = tcp://127.0.0.1:5557

[watcher:webworker]
cmd = chaussette --fd $(circus.sockets.webapp) app.application
use_sockets = $(circus.sockets.webapp)
numprocesses = 3

[socket:webapp]
host = 127.0.0.1
port = 8080
tarekziade commented 12 years ago

Yeah that's pretty cool. although I think you can simplify the use_sockets notation. what about:

[circus]
check_delay = 5
endpoint = tcp://127.0.0.1:5555
pubsub_endpoint = tcp://127.0.0.1:5556
stats_endpoint = tcp://127.0.0.1:5557

[watcher:yeah]
cmd = script --fds $(circus.sockets.foo),$(circus.sockets.baz)  
used_sockets = baz, foo
numprocesses = 3

[watcher:webworker]
cmd = chaussette --fd $(circus.sockets.foo) app.application
used_sockets = foo 
numprocesses = 3

[socket:foo]
host = 127.0.0.1
port = 8080

[socket:baz]
host = 127.0.0.1
port = 8888
Natim commented 11 years ago

Then it means we need to manage the number of running process linked to the watcher before to actually stop the socket.

peta15 commented 11 years ago

Re #649 I take it that stopsocket and delsocket are waiting to be implemented and that once they are then that will solve my issue?

Natim commented 11 years ago

Yes something like that :)

taylortrimble commented 11 years ago

@tarekziade I see that this is on an 0.9 deadline that has slipped by a few months: is this in-progress at all? I like the ability to add watchers via ZMQ, and it would be equally amazing to do so for sockets!