7.10. Clara Pipeline Driver Callbacks

7.10.1. Prepare

Provided by application code to the driver when calling clara.Driver constructor, and called by the driver once driver initialization has completed. Application code is expected to perform any preparation or setup steps necessary when this function is called.

Providing a preparation callback handler to the driver is optional. When no callback handler is provided, the driver will move directly from initialization to waiting for inputs for execution.

Parameters

  • driver

    type: clara.Driver

    Reference to the Clara Pipeline Driver instance which is calling this method.

Return

Returns True if successful; otherwise a False value.

see also: Clara Pipeline Driver

lambda driver: True

7.10.2. Execute

Provided by application code to the driver when calling clara.Driver constructor, and called by the driver once inputs are ready for consumption. Application code will be provided a clara.Payload pointer which can be used to obtain information about the payload.

Providing an execution callback handler to the driver is optional. When no callback handler is provided, the driver will move directly from waiting for inputs to clean-up.

see also: Clara Pipeline Driver

Parameters

  • driver

    type: clara.Driver

    Reference to the Clara Pipeline Driver instance which is calling this method.

  • payload

    type: clara.Payload

    Reference to the current stage’s payload.

Return

Returns True if successful; otherwise a False value.

lambda driver, payload: True

7.10.3. Cleanup

Provided by application code to the driver when calling clara.Driver constructor, and called by the driver after execution is complete and internal driver clean up has completed. The application is expected to perform any clean or finalization steps during this callback event.

Providing a clean-up callback handler to the driver is optional. When no callback handler is provided, the driver will move directly from clean-up to internal finalization.

see also: Clara Pipeline Driver

Parameters

  • driver

    type: clara.Driver

    Reference to the Clara Pipeline Driver instance which is calling this method.

Return

Returns True if successful; otherwise a False value.

lambda driver: True

7.10.4. Notification

Provided by application code to the driver when calling clara.Driver constructor, and called by the driver when any noteworthy event happens. This includes internal errors.

Providing a notification callback handler to the driver is optional. When no callback handler is provided, the driver will be unable to notify application code of any internal errors or critical state changes.

see also: Clara Pipeline Driver

Parameters

  • driver

    type: clara.Driver

    Reference to the Clara Pipeline Driver instance which is calling this method.

  • result

    type: int

    The result, or return code, of the event calling this method.

  • message

    type: string

    The detailed information about the event causing the notification event.

  • is_fatal

    type: bool

    True when the event generating the notification is fatal; otherwise False.

Return

lambda driver, result, message, is_fatal: None