{"id":19672029,"url":"https://github.com/michelp/nerve","last_synced_at":"2026-06-06T21:31:30.210Z","repository":{"id":2698234,"uuid":"3691671","full_name":"michelp/nerve","owner":"michelp","description":"Distributed Process Supervisor","archived":false,"fork":false,"pushed_at":"2012-09-18T00:46:20.000Z","size":187,"stargazers_count":4,"open_issues_count":4,"forks_count":0,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-02-27T05:14:30.554Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/michelp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-03-12T03:05:35.000Z","updated_at":"2024-11-28T16:29:50.000Z","dependencies_parsed_at":"2022-09-14T19:21:51.263Z","dependency_job_id":null,"html_url":"https://github.com/michelp/nerve","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/michelp/nerve","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michelp%2Fnerve","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michelp%2Fnerve/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michelp%2Fnerve/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michelp%2Fnerve/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/michelp","download_url":"https://codeload.github.com/michelp/nerve/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michelp%2Fnerve/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34001197,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-06T02:00:07.033Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T17:10:38.597Z","updated_at":"2026-06-06T21:31:30.170Z","avatar_url":"https://github.com/michelp.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Intro\n\nNerve is a distributed process supervision tool written in Python\nand built on top of 0mq and gevent.\n\nNerve is distributed in the sense that the supervising program and the\nprocess being supervised are decoupled via a 0mq communication\nchannel. Regardless if whether a process is running locally to a nerve\nor on some other machine, a consistent set of command-line tools is\nused to manage all processes across many machines.\n\n\n\n\t    +------------+             +------------+\n\t    |   Center   |             |   Center   |\n\t    |------------|             |------------|\n\t    |   +----+   |             |   +----+   |\n\t    |   |    |   |\u003c-----------+|   |    |   |\n\t    |   | DB |   |             |   | DB |   |\n\t    |   |    |   |             |   |    |   |\n\t    |   +----+   |             |   +----+   |\n\t    +------------+             +------------+\n\t\t  +                          ^\n\t\t  |                          |\n\t\t  |                          |\n\t\t  |                          |\n\t\t  v                          +\n\t    +------------+             +------------+\n\t    |   Center   |             |   Center   |\n\t    |------------|             |------------|\n\t    |   +----+   |             |   +----+   |\n\t    |   |    |   |+-----------\u003e|   |    |   |\n\t    |   | DB |   |             |   | DB |   |\n\t    |   |    |   |             |   |    |   |\n\t    |   +----+   |             |   +----+   |\n\t    +------------+             +------------+\n\t\t     ^\n                     |\n\t\t     |\n\t\t     |\n\t\t   +-|---------------------+\n\t\t   | |       DEALER        |\n\t\t   |-|---------------------|\n\t\t   | |         +---------+ |\n\t      \u003c----|-+--stdio--|         | |\n\t\t   | |         |         | |\n\t      \u003c----|-+-signals-| subproc | |\n\t\t   | |         |         | |\n\t\t   | +--stats--|         | |\n\t\t   |           +---------+ |\n\t\t   +-----------------------+\n\n## Installation\n\nNerve can be installed from pypi using either easy_install or pip:\n\n    $ easy_install nerve\n    \nThis will download and install the lastest version of nerve into\nyour environment.  This will install the programs 'nerve-center' and\n'nrv-open':\n\n## Getting started\n\nHere are some examples:\n\nTypically when using nerve the first task will be to create a\nnerve process.\n\n    $ nrv-center\n\nThis command runs a local nerve center process and connects it to the\ndefault endpoint 'ipc://nerve.sock' which creates a domain socket of\nthat name in the local directory where nerve was run.\n\nNow a nerve process is running waiting for processes to monitor to\nbe started.  For example, consider the standard unix program 'echo':\n\n    $ echo bob is your uncle\n    bob is your uncle\n    $\n\nThe echo process started, echoed its arguments to its standard output,\nand then exited.  This process can be watched starting it instead with\nthe 'nrv-open' command:\n\n    $ nrv-open echo bob is your uncle\n    bob is your uncle\n    $\n\nSeems like nothing special happened, but the state and output of the\nprocess was not only returned to the shell, but also sent to the\nnerve, as can be seen by tailing the logs:\n\n    $ tail nerve.log\n    ['\\x00k\\x8bEg', 'start', 12998L]\n    ['\\x00k\\x8bEg', 'out', 'bob is your uncle\\n']\n    ['\\x00k\\x8bEg', 'return', 0L]\n\nThe watcher process contacted the nerve, told it the child was\nstarting (and the pid), repeated the output of the program, then\nindicated the process returned with code '0'.\n\nThere are 3 processes at work here: the 'nerve' process runs\ncontinuously and collects data from watchers.  The 'nrv-open' process\nspawns child processes and watches them for activity, sending events\nand I/O data to the nerve, and finally there is the watched\nprocess, blissfully doing its thing completely unaware of the\nintervention of nrv-open and nerve.\n\nThe way nrv-open and nerve interact with each other by default is\nover the zeromq endpoint 'ipc://nerve.sock'.  On unix this creates\na local unix domin socket file.  All nerve tools however take the\n'-e' or '--endpoint' arguments to send the endpoint where the\nnerve and the vzwatch will rendezvous.\n\n0mq sockets can connect not only over ipc, but tcp as well.  This\nallows nerve connections over the network:\n\n    $ nerve-center --endpoint tcp://*:44444\n    \nNow the nerve daemon is listening on the localhost port 44444.  A\nnrv-open can be launched wit the same argument:\n\n    $ nrv-open --endpoint tcp://localhost:44444 echo bob is your uncle\n\nTail the nerve.log file and you will see that the same information\nas before is reported to the nerve, but this time, over a network\nconnection.  The nerve can be running on one machine and the\nwatched process on another.  This is one part of the distributed\nnature of nerve.\n\n# Fiction below\n\n# Controling a nerve\n\nA nerve not only listens on a process endpoint for information\nfrom processes, it also as a \"control\" endpoint that lets you interact\nwith the nerve daemon and control watched processes by sending\nthem input or signals and watching their response.\n\n# Nerve rings\n\nNerves are not only a central athority, they also can cooperate\nwith other nerves in a \"ring\".  This provides a consistent\ninterface for controlling a whole cluster of nerves, which in\nturn, control many processes.\n\n# Watching nerves with nerves\n\n'nrv-open' can be used to watch nerve, in turn reporting to a\n\"meta\" nerve.  Typically one master nerve will watch a ring of\nnerves, which in turn watch a cluster of processes.\n\n# Using nerve.nrv-open.Popen\n\nThe 'nrv-open' program is a wrapper around a class that mimics the\noperation of the 'subprocess.Popen' class.\n\nNote that the nerve Popen is not a perfect clone of Popen.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichelp%2Fnerve","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmichelp%2Fnerve","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichelp%2Fnerve/lists"}