Struct HttpServerSourceStageInterfaceProxy
Defined in File http_server_source_stage.hpp
-
struct HttpServerSourceStageInterfaceProxy
Interface proxy, used to insulate python bindings.
Public Static Functions
-
static std::shared_ptr<mrc::segment::Object<HttpServerSourceStage<MessageMeta>>> init_meta(mrc::segment::Builder &builder, const std::string &name, std::string bind_address, unsigned short port, std::string endpoint, std::string live_endpoint, std::string ready_endpoint, std::string method, std::string live_method, std::string ready_method, unsigned accept_status, float sleep_time, long queue_timeout, std::size_t max_queue_size, unsigned short num_server_threads, std::size_t max_payload_size, int64_t request_timeout, bool lines, std::size_t stop_after)
Create and initialize a HttpServerSourceStage that emits MessageMeta’s, and return the result.
- Parameters
builder – : Pipeline context object reference
name – : Name of a stage reference
bind_address – The IP address to bind the server to
port – The TCP port to bind the server to
endpoint – The endpoint to listen for messages on
live_endpoint – The endpoint to check if the server is running
ready_endpoint – The endpoint to check if the server is ready to accept messages
method – The HTTP method to accept requests on the
endpoint
live_method – The HTTP method to accept requests on the
live_endpoint
ready_method – The HTTP method accept requests on the
ready_endpoint
accept_status – The HTTP status code to return when a message is accepted
sleep_time – The time to sleep when the queue is empty
queue_timeout – The time to wait for the queue to accept a message
max_queue_size – The maximum number of messages to queue prior to blocking incoming requests
num_server_threads – The number of threads to run the server on
max_payload_size – The maximum size of the payload
request_timeout – The time to wait for a request to complete
lines – If
False
, the HTTP server will expect each request to be a JSON array of objects. IfTrue
, the HTTP server will expect each request to be a JSON object per line.stop_after – The number of records to emit before stopping. Useful for testing, disabled if
0
.
-
static std::shared_ptr<mrc::segment::Object<HttpServerSourceStage<ControlMessage>>> init_cm(mrc::segment::Builder &builder, const std::string &name, std::string bind_address, unsigned short port, std::string endpoint, std::string live_endpoint, std::string ready_endpoint, std::string method, std::string live_method, std::string ready_method, unsigned accept_status, float sleep_time, long queue_timeout, std::size_t max_queue_size, unsigned short num_server_threads, std::size_t max_payload_size, int64_t request_timeout, bool lines, std::size_t stop_after, const pybind11::object &task_type, const pybind11::object &task_payload)
Create and initialize a HttpServerSourceStage that emits ControlMessage’s, and return the result.
- Parameters
builder – : Pipeline context object reference
name – : Name of a stage reference
bind_address – The IP address to bind the server to
port – The TCP port to bind the server to
endpoint – The endpoint to listen for messages on
live_endpoint – The endpoint to check if the server is running
ready_endpoint – The endpoint to check if the server is ready to accept messages
method – The HTTP method to accept requests on the
endpoint
live_method – The HTTP method to accept requests on the
live_endpoint
ready_method – The HTTP method accept requests on the
ready_endpoint
accept_status – The HTTP status code to return when a message is accepted
sleep_time – The time to sleep when the queue is empty
queue_timeout – The time to wait for the queue to accept a message
max_queue_size – The maximum number of messages to queue prior to blocking incoming requests
num_server_threads – The number of threads to run the server on
max_payload_size – The maximum size of the payload
request_timeout – The time to wait for a request to complete
lines – If
False
, the HTTP server will expect each request to be a JSON array of objects. IfTrue
, the HTTP server will expect each request to be a JSON object per line.stop_after – The number of records to emit before stopping. Useful for testing, disabled if
0
.task_type – Optional task type to be added to all outgoing messages. When not
None
, thentask_payload
must also be notNone
, and vice versa.task_payload – Optional json object describing the task to be added to all outgoing messages. When not
None
, thentask_type
must also be notNone
, and vice versa.
-
static std::shared_ptr<mrc::segment::Object<HttpServerSourceStage<MessageMeta>>> init_meta(mrc::segment::Builder &builder, const std::string &name, std::string bind_address, unsigned short port, std::string endpoint, std::string live_endpoint, std::string ready_endpoint, std::string method, std::string live_method, std::string ready_method, unsigned accept_status, float sleep_time, long queue_timeout, std::size_t max_queue_size, unsigned short num_server_threads, std::size_t max_payload_size, int64_t request_timeout, bool lines, std::size_t stop_after)