ITransport¶
ITransport defines an abstract interface for sending asynchronous HTTP POST requests, allowing components to perform remote communication with external services.
class ITransport : public ISubsystem {
public:
virtual ~ITransport() = default;
virtual void post(
std::string_view url,
std::string_view body,
const std::vector<std::pair<std::string_view, std::string_view>>& headers,
MoveOnlyFunction<void(std::string_view)> onSuccess,
MoveOnlyFunction<void(std::string_view)> onError) = 0;
};
ITransport derives from ISubsystem, so an implementation also
inherits start() and stop(). Both have empty default bodies — override them if the transport owns
a connection pool, an event loop, or a worker thread that must be brought up and torn down with the
engine.
Purpose¶
- Provide a generic mechanism to send HTTP POST requests without coupling to a specific transport library or implementation.
- Enable integration with APIs, webhooks, or external risk/configuration services.
Responsibilities¶
| Method | Description |
|---|---|
post() |
Sends a POST request to the specified URL with custom headers and body. Invokes success or error callback based on result. |
start() |
Inherited from ISubsystem. Default no-op. |
stop() |
Inherited from ISubsystem. Default no-op. |