Skip to content

Instantly share code, notes, and snippets.

@decklord
Created December 5, 2013 19:39
Show Gist options
  • Save decklord/7812432 to your computer and use it in GitHub Desktop.
Save decklord/7812432 to your computer and use it in GitHub Desktop.
Load watcher on running CIRCUS instance.
from circus.client import CircusClient, make_message
from circus.util import DEFAULT_ENDPOINT_DEALER
client = CircusClient(endpoint=DEFAULT_ENDPOINT_DEALER)
virtual_env_dir = "/path/to/.virtualenvs/virtualenv/bin"
watcher_options = {
"numprocesses": 2,
"working_dir": "my/path/to/file",
}
process = {
"name":"Test Print",
"options": watcher_options,
"executable" : "python",
"cmd": "%s/python printer.py" % (virtual_env_dir),
"start": True
}
print client.call(make_message("add", **process))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment