Class ForwardTask

Inheritance Relationships

Base Type

Class Documentation

stage.ForwardTask : public stage.Task
A ForwardTask reads messages from some input queues performs some
action/transformation and forwards the outcome to some output queue.

Attributes:
    application_name: The name of the application currently being used
    db_url: url to sql server that stores metadata of files.
    i_queue: The input queue to read input message
    o_queue: The output queue to write the transformed messages
    user_obj: An object providing the update_model_cb and data_cb callbacks to be applied on the respective control messages before pushing it to the next stage.

Public Functions

__init__(self, application_name, db_url, i_queue, o_queue, user_obj)
initializes a ForwardTask class with the queues and the callback.
__call__(self)
A busy loop reading messages from the i_queue, acting on those messages and forwarding
the output to the output queue. In the case of receiving a 'termination' messages informs
the tasks waiting on the output queues about the terminations and returns from the function.

Public Members

application_name
db_url
i_queue
o_queue
user_obj
datasize_byte

Protected Functions

_data_cb(self, data)
Apply an 'action' to the incoming data

Args:
    data: A DataBlob of inputs, outputs to be transformed

Returns:
    A pair of inputs, outputs of the data after the transformation
_model_update_cb(self, db, msg)