Go to the source code of this file.
Classes | |
| struct | eonc::ServeEndpoint |
| Configuration for a single serve endpoint. More... | |
| struct | ServeEndpoint |
| Configuration for a single serve endpoint. More... | |
Namespaces | |
| namespace | eonc |
| RAII resource manager for the ARTn C library with global synchronization. | |
Functions | |
| void | eonc::serveMode (const Parameters ¶ms, const std::string &host, uint16_t port) |
| Start a single rgpot-compatible Cap'n Proto RPC server. | |
| void | eonc::serveMultiple (const std::vector< ServeEndpoint > &endpoints, const Parameters ¶ms) |
| Serve multiple potentials concurrently on different ports. | |
| void | eonc::serveReplicated (const Parameters ¶ms, const std::string &host, uint16_t base_port, size_t replicas) |
| Serve N replicas of the same potential across sequential ports. | |
| void | eonc::serveGateway (const Parameters ¶ms, const std::string &host, uint16_t port, size_t pool_size) |
| Start a gateway server backed by a pool of potential instances. | |
| void | eonc::serveFromConfig (const Parameters ¶ms) |
| Start serve mode from config-file parameters. | |
| std::vector< ServeEndpoint > | eonc::parseServeSpec (const std::string &spec) |
| Parse a serve configuration string into endpoints. | |
| std::vector< ServeEndpoint > | parseServeSpec (const std::string &spec) |
| Parse a serve configuration string into endpoints. | |
| void | serveFromConfig (const Parameters ¶ms) |
| Start serve mode from config-file parameters. | |
| void | serveGateway (const Parameters ¶ms, const std::string &host, uint16_t port, size_t pool_size) |
| Start a gateway server backed by a pool of potential instances. | |
| void | serveMode (const Parameters ¶ms, const std::string &host, uint16_t port) |
| Start a single rgpot-compatible Cap'n Proto RPC server. | |
| void | serveMultiple (const std::vector< ServeEndpoint > &endpoints, const Parameters ¶ms) |
| Serve multiple potentials concurrently on different ports. | |
| void | serveReplicated (const Parameters ¶ms, const std::string &host, uint16_t base_port, size_t replicas) |
| Serve N replicas of the same potential across sequential ports. | |
| std::vector< ServeEndpoint > eonc::parseServeSpec | ( | const std::string & | spec | ) |
Parse a serve configuration string into endpoints.
Accepts comma-separated entries of the form "potential:port" or "potential:host:port". Examples: "lj:12345" "metatomic:12345,lj:12346" "metatomic:0.0.0.0:12345"
| spec | The comma-separated endpoint specification. |
Definition at line 229 of file ServeMode.cpp.
| void eonc::serveFromConfig | ( | const Parameters & | params | ) |
Start serve mode from config-file parameters.
Reads serve_options from params and dispatches to the appropriate mode:
| params | The eOn parameters with serve_options populated. |
Definition at line 200 of file ServeMode.cpp.
| void eonc::serveGateway | ( | const Parameters & | params, |
| const std::string & | host, | ||
| uint16_t | port, | ||
| size_t | pool_size ) |
Start a gateway server backed by a pool of potential instances.
Creates pool_size instances of the configured potential and serves them behind a single gateway port. Incoming requests are dispatched round-robin across the pool. This gives clients a single endpoint while spreading load.
| params | The eOn parameters (potential_options.potential must be set). |
| host | The hostname to listen on. |
| port | The gateway port. |
| pool_size | Number of potential instances in the pool. |
Definition at line 167 of file ServeMode.cpp.
| void eonc::serveMode | ( | const Parameters & | params, |
| const std::string & | host, | ||
| uint16_t | port ) |
Start a single rgpot-compatible Cap'n Proto RPC server.
Wraps eOn's Potential::force() as an rgpot PotentialBase and serves it over Cap'n Proto RPC. Blocks until the server is killed.
| params | The eOn parameters (potential_options.potential must be set). |
| host | The hostname to listen on (e.g., "localhost" or "*"). |
| port | The TCP port to listen on. |
Definition at line 56 of file ServeMode.cpp.
| void eonc::serveMultiple | ( | const std::vector< ServeEndpoint > & | endpoints, |
| const Parameters & | params ) |
Serve multiple potentials concurrently on different ports.
Each endpoint gets its own thread, its own potential instance, and its own Cap'n Proto event loop. All threads block until SIGINT/SIGTERM.
| endpoints | List of {potential, host, port} configurations. |
| params | Base eOn parameters (potential type is overridden per endpoint). |
Definition at line 79 of file ServeMode.cpp.
| void eonc::serveReplicated | ( | const Parameters & | params, |
| const std::string & | host, | ||
| uint16_t | base_port, | ||
| size_t | replicas ) |
Serve N replicas of the same potential across sequential ports.
Starts replicas threads, each serving the same potential type on ports base_port, base_port+1, ..., base_port+replicas-1.
| params | The eOn parameters (potential_options.potential must be set). |
| host | The hostname to listen on. |
| base_port | The first port; replicas use base_port+0 .. base_port+N-1. |
| replicas | Number of concurrent server instances. |
Definition at line 133 of file ServeMode.cpp.