- class jina.serve.stream.RequestStreamer(request_handler, result_handler, prefetch=0, end_of_iter_handler=None, logger=None, **logger_kwargs)#
A base async request/response streamer.
None]]) – Optional callable to handle the end of iteration if some special action needs to be taken.
int) – How many Requests are processed from the Client at the same time.
JinaLogger]) – Optional logger that can be used for logging
logger_kwargs – Extra keyword arguments that may be passed to the internal logger constructor if none is provided
- async stream(request_iterator, context=None, results_in_order=False, *args)#
stream requests from client iterator and stream responses back.
request_iterator – iterator of requests
context – context of the grpc call
bool) – return the results in the same order as the request_iterator
args – positional arguments
responses from Executors
- Return type:
- async wait_floating_requests_end()#
Await this coroutine to make sure that all the floating tasks that the request handler may bring are properly consumed