![]() |
Qore yaml Module 1.1.0
|
this class implements a chunked request handler supporting the DataStream protocol More...
#include <DataStreamRequestHandler.qm.dox.h>
Inherits RestHandler::AbstractRestStreamRequestHandler.
Public Member Methods | |
| soft< hash< auto > > | getErrorResponse () |
| if an error occurred, then return a hash giving an error response, otherwise return nothing | |
| hash< auto > | getResponseHeaderMessageImpl () |
| returns the response header to the request | |
| nothing | recvImpl (hash v) |
| calls the receive callback as returned by the DataStreamUtil module | |
| auto | sendImpl () |
| calls the send callback as returned by the DataStreamUtil module | |
| nothing | recvDataDone (soft< string > err) |
| this method is called when all data has been received | |
| nothing | recvData (auto data) |
| This is the concrete method called when data is received; it calls recvDataImpl() in turn. | |
| auto | sendData () |
| This is the concrete method called when data is received; it calls recvDataImpl() in turn. | |
| nothing | recvDataDoneImpl (soft< string > err) |
| this method is called when all data has been received | |
| abstract nothing | recvDataImpl (auto data) |
| reimplement this method in subclasses to receive decoded and deserialized data | |
| abstract auto | sendDataImpl () |
| reimplement this method in subclasses to support streamed data transfers | |
Public Attributes | |
| code | recv_callback |
| the receive callback as returned by the DataStreamUtil module | |
| code | scb |
| the send callback as returned by the DataStreamUtil module | |
| int | err |
| HTTP status code for error response sent. | |
| soft< string > | send_error |
| send error string received | |
this class implements a chunked request handler supporting the DataStream protocol
this class must be subclassed and then the recvDataImpl and sendDataImpl methods reimplemented to provide data receiving and sending support, respectively.
| soft< hash< auto > > DataStreamRequestHandler::AbstractDataStreamRequestHandler::getErrorResponse | ( | ) |
if an error occurred, then return a hash giving an error response, otherwise return nothing
this method is meant to be called by getResponseHeaderMessageImpl()
| hash< auto > DataStreamRequestHandler::AbstractDataStreamRequestHandler::getResponseHeaderMessageImpl | ( | ) |
returns the response header to the request
"code": the HTTP return code (see HttpServer::HttpCodes)"body": the message body to return in the response; if this key is returned, then the reply is sent immediately; a chunked reply is not made, and send() and sendImpl() are not called"close": (optional) set this key to True if the connection should be unconditionally closed when the handler returns"hdr": (optional) set this key to a hash of extra header information to be returned with the response| nothing DataStreamRequestHandler::AbstractDataStreamRequestHandler::recvData | ( | auto | data | ) |
This is the concrete method called when data is received; it calls recvDataImpl() in turn.
| data | the data received |
| abstract nothing DataStreamRequestHandler::AbstractDataStreamRequestHandler::recvDataImpl | ( | auto | data | ) |
reimplement this method in subclasses to receive decoded and deserialized data
| data | the argument passed to this callback is the decoded and deserialized data in the message |
| nothing DataStreamRequestHandler::AbstractDataStreamRequestHandler::recvImpl | ( | hash | v | ) |
calls the receive callback as returned by the DataStreamUtil module
The receive callback calls recvDataImpl to deliver deserialized data
| auto DataStreamRequestHandler::AbstractDataStreamRequestHandler::sendData | ( | ) |
This is the concrete method called when data is received; it calls recvDataImpl() in turn.
| abstract auto DataStreamRequestHandler::AbstractDataStreamRequestHandler::sendDataImpl | ( | ) |
reimplement this method in subclasses to support streamed data transfers
When this method returns no value, it signifies the end of the streamed data transfer
| auto DataStreamRequestHandler::AbstractDataStreamRequestHandler::sendImpl | ( | ) |
calls the send callback as returned by the DataStreamUtil module
The send callback calls sendDataImpl to get the data to serialize and encode and send as a response