jina.peapods.runtimes.request_handlers.data_request_handler module

class jina.peapods.runtimes.request_handlers.data_request_handler.DataRequestHandler(args, logger, **kwargs)[source]

Bases: object

Object to encapsulate the code related to handle the data requests passing to executor and its returned values

Initialize private parameters and execute private loading functions.

Parameters
  • args (argparse.Namespace) – args from CLI

  • logger (JinaLogger) – the logger provided by the user

  • kwargs – extra keyword arguments

handle(msg, partial_requests, peapod_name)[source]

Initialize private parameters and execute private loading functions.

Parameters
  • msg (Message) – The message to handle containing a DataRequest

  • partial_requests (Optional[List[Request]]) – All the partial requests, to be considered when more than one expected part

  • peapod_name (str) – the name of the peapod owning this handler

static replace_docs(msg, docs)[source]

Replaces the docs in a message with new Documents.

Parameters
  • msg – The message object

  • docs – the new docs to be used

close()[source]

Close the data request handler, by closing the executor