jina.clients.request.asyncio module

Module for async requests generator.

jina.clients.request.asyncio.request_generator(exec_endpoint, data, request_size=0, data_type=<DataInputType.AUTO: 0>, target_peapod=None, parameters=None, **kwargs)[source]

An async :function:`request_generator`.

Parameters
  • exec_endpoint (str) – the endpoint string, by convention starts with /

  • data (Union[Document, Iterable[Union[~DocumentContentType, ~DocumentSourceType, Document, Tuple[~DocumentContentType, ~DocumentContentType], Tuple[~DocumentSourceType, ~DocumentSourceType]]], AsyncIterable[Union[~DocumentContentType, ~DocumentSourceType, Document, Tuple[~DocumentContentType, ~DocumentContentType], Tuple[~DocumentSourceType, ~DocumentSourceType]]]]) – the data to use in the request

  • request_size (int) – the number of Documents per request

  • data_type (DataInputType) – if data is an iterator over self-contained document, i.e. DocumentSourceType; or an iterator over possible Document content (set to text, blob and buffer).

  • parameters (Optional[Dict]) – the kwargs that will be sent to the executor

  • target_peapod (Optional[str]) – a regex string represent the certain peas/pods request targeted

  • kwargs – additional arguments

Yield

request

Return type

AsyncIterator[Request]