Python Receptor and the 0.6 versions
As of June 25th, this repo is the Go implementation of Receptor. If you are looking for the older Python version of Receptor, including any 0.6.x version, it is now located at https://github.com/project-receptor/python-receptor.
Receptor is an overlay network intended to ease the distribution of work across a large and dispersed collection of workers. Receptor nodes establish peer-to-peer connections with each other via existing networks. Once connected, the Receptor mesh provides datagram (UDP-like) and stream (TCP-like) capabilities to applications, as well as robust unit-of-work handling with resiliency against transient network failures.
Terminology and Concepts
- Node: A single running instance of Receptor.
- Node ID: The network address of a Receptor node. Currently a simple string.
- Service: An up-to-8-character string identifying an endpoint on a Receptor node that can receive messages. Analogous to a port number in TCP or UDP.
- Backend: A type of connection between nodes that the Receptor network protocol can run over. Current backends include TCP, UDP and websockets.
- Unit of work: A single task that is intended to be run on a node. For example, a command invocation or an Ansible playbook.
- Response: A single item from a stream of responses arising from the execution of a unit of work. For Ansible playbooks, these are job events.
- Controller: An application-level process that creates units of work and sends them to nodes to be executed.
- Worker: A process that binds to a Receptor service and registers itself as capable of executing jobs of a particular type.
Use as a Go library
This code can be imported and used from Go programs. The main libraries are
netceptor, which implements the network protocol, and
implements the unit-of-work handling. See the
example/ directory for
examples of using these libraries from Go.
Use as a command-line tool
receptor command runs a Receptor node with access to all included
backends and services. See
receptor --help for details.
The command-line tool includes services that implement network proxies via TCP, UDP or (on Linux) tun interfaces. For example, the following command will start a TCP proxy that listens for TCP connections on port 1234 on localhost, and then forwards each connection to port 4321.
receptor --node-id standalone --local-only \ --tcp-inbound-proxy port=1234 remotenode=standalone remoteservice=proxy \ --tcp-outbound-proxy address=localhost:4321 service=proxy
workceptor library will handle unit-of-work management. This is still