|
CMSDK 2.0.1
Cross-platform C++ base library and SDK for the Psyclone AIOS platform
|
The distributed request/response fabric: RequestClient posts requests, RequestGateway routes and load-balances them, RequestExecutor processes them and replies. More...
The distributed request/response fabric: RequestClient posts requests, RequestGateway routes and load-balances them, RequestExecutor processes them and replies.
Files | |
| file | RequestExecutor.h |
| Request-system worker side: RequestExecutor pulls requests from a RequestGateway, processes them and replies. | |
| file | RequestGateway.h |
| Request-system router: RequestGateway accepts client requests (binary/HTTP/WebSocket), load-balances them across RequestExecutors and routes replies back; includes a call log and an embedded web server. | |
| file | RequestClient.cpp |
| Implementation of the request-system client side: RequestReply completion/waiting, RequestClient's gateway connection upkeep, request dispatch and reply matching, plus the load-test clients used by the gateway unit test. | |
| file | RequestExecutor.cpp |
| Implementation of the request-system worker side: gateway link upkeep with heartbeats, short/long request queueing and the reply path, plus the delay-simulating TestRequestExecutor. | |
| file | RequestGateway.cpp |
| Implementation of the request-system router: ingress over binary/ HTTP/WebSocket, executor load balancing and liveness (heartbeat timeout, dead-executor redistribution), reply routing, the RequestQueue, call logging, the built-in web server/APIs, and the end-to-end unit test. | |
Classes | |
| class | cmlabs::RequestReply |
| Future/handle for one in-flight request: holds the request message, the eventual reply, status, timing and routing references. More... | |
| class | cmlabs::RequestQueue |
| Priority-ordered queue of pending RequestReply objects (per executor connection). More... | |
| struct | cmlabs::RequestConnection |
| Gateway-side record of one connected client or executor. More... | |
| struct | cmlabs::RequestGatewayConnection |
| Client/executor-side record of one gateway it connects to. More... | |
| class | cmlabs::RequestClient |
| Application-facing client of the request system: posts DataMessage requests to one or more RequestGateways and delivers replies. More... | |
| class | cmlabs::TestRequestClient |
| Load-test client driving a RequestGateway with binary-protocol requests at a configurable frequency/payload (used by RequestGateway::UnitTest()). More... | |
| class | cmlabs::TestWebRequestClient |
| Load-test client driving a RequestGateway over plain HTTP web requests. More... | |
| class | cmlabs::TestWebSocketRequestClient |
| Load-test client driving a RequestGateway over WebSocket connections. More... | |
| class | cmlabs::RequestExecutor |
| Worker node of the request system: receives requests from gateways, queues them by class (short/long) and sends back replies. More... | |
| class | cmlabs::TestRequestExecutor |
| Test executor that services requests with a configurable artificial processing delay; used by RequestGateway::UnitTest(). More... | |
| class | cmlabs::CallLogEntry |
| One entry of the gateway's call log: who called what, how it was routed, how long each stage took, and the outcome. More... | |
| class | cmlabs::RequestGateway |
| The request-fabric router/load-balancer (see the file header for the full role description). More... | |
Typedefs | |
| typedef void(* | cmlabs::RequestCallbackFunction) (RequestReply &reply) |
| Signature for asynchronous completion callbacks registered on a RequestReply. | |
Enumerations | |
| enum | cmlabs::RequestStatus { cmlabs::NONE = 0 , cmlabs::IDLE = 1 , cmlabs::QUEUED = 2 , cmlabs::PROCESSING = 3 , cmlabs::SENT = 4 , cmlabs::SUCCESS = 5 , cmlabs::FAILED = 6 , cmlabs::TIMEOUT = 7 , cmlabs::TOOBUSY = 8 , cmlabs::LOCALERROR = 9 , cmlabs::NETWORKERROR = 10 , cmlabs::SERVERERROR = 11 } |
| Lifecycle states of a request as it moves through client, gateway and executor. More... | |
Functions | |
| THREAD_RET THREAD_FUNCTION_CALL | cmlabs::RequestClientRun (THREAD_ARG arg) |
| Thread entry point for the RequestClient worker loop. | |
| THREAD_RET THREAD_FUNCTION_CALL | cmlabs::RequestExecutorRun (THREAD_ARG arg) |
| Thread entry point for the RequestExecutor worker loop. | |
| THREAD_RET THREAD_FUNCTION_CALL | cmlabs::RequestGatewayExecRun (THREAD_ARG arg) |
| Thread entry point for the gateway's executor-side loop. | |
| THREAD_RET THREAD_FUNCTION_CALL | cmlabs::RequestGatewayClientRun (THREAD_ARG arg) |
| Thread entry point for the gateway's client-side loop. | |
| typedef void(* cmlabs::RequestCallbackFunction) (RequestReply &reply) |
Signature for asynchronous completion callbacks registered on a RequestReply.
Invoked on an internal client thread when the request completes (any status).
Definition at line 114 of file RequestClient.h.
Lifecycle states of a request as it moves through client, gateway and executor.
Terminal states (SUCCESS and the failure states) make RequestReply::isComplete() true.
| Enumerator | |
|---|---|
| NONE | |
| IDLE | |
| QUEUED | |
| PROCESSING | |
| SENT | |
| SUCCESS | |
| FAILED | |
| TIMEOUT | |
| TOOBUSY | |
| LOCALERROR | |
| NETWORKERROR | |
| SERVERERROR | |
Definition at line 119 of file RequestClient.h.
| THREAD_RET THREAD_FUNCTION_CALL cmlabs::RequestClientRun | ( | THREAD_ARG | arg | ) |
Thread entry point for the RequestClient worker loop.
Definition at line 704 of file RequestClient.cpp.
| THREAD_RET THREAD_FUNCTION_CALL cmlabs::RequestExecutorRun | ( | THREAD_ARG | arg | ) |
Thread entry point for the RequestExecutor worker loop.
Definition at line 511 of file RequestExecutor.cpp.
| THREAD_RET THREAD_FUNCTION_CALL cmlabs::RequestGatewayClientRun | ( | THREAD_ARG | arg | ) |
Thread entry point for the gateway's client-side loop.
Definition at line 2470 of file RequestGateway.cpp.
| THREAD_RET THREAD_FUNCTION_CALL cmlabs::RequestGatewayExecRun | ( | THREAD_ARG | arg | ) |
Thread entry point for the gateway's executor-side loop.
Definition at line 2465 of file RequestGateway.cpp.