flowbber.components.base

Base class for all Flowbber components.

All Flowbber components extend from the Component class.

Classes

class flowbber.components.base.ExecutionInfo(status, duration, pid, exitcode, data)

Component execution information object.

Variables
  • status – Word used to describe the status of the execution. For example: succeeded, crashed, killed, hanged or timed out.
  • duration – Duration time in seconds of the execution of the process.
  • pid – Pid of the executing process.
  • exitcode – Exit code of the executing process. Can be None if status is hanged.
  • data – Data returned by the executing process, if any.

Inheritance

Inheritance diagram of ExecutionInfo

class flowbber.components.base.Component(index, type_, id_, optional=False, timeout=None, config=None)

Base Component class.

All Component classes (Sink, Aggregator, Source) extend from this class.

Properties:

Variables
  • index (int) – Position of this component in the pipeline definition.
  • id (str) – Unique identifier for this component.
  • optional (bool) – Successful execution of this component is optional. That is, it is allowed to fail and the pipeline won’t fail.
  • timeout (int) – Execution timeout for this component, in seconds. None means no timeout, wait forever.
  • Component.config (namedtuple) – Frozen configuration after validation.

Parameters:

Parameters
  • index (int) – Value to set the index property.
  • type (str) – Type key used to fetch this component.
  • id (str) – Value to set the id property.
  • optional (bool) – Value to set the optional property.
  • timeout (int) – Value to set the timeout property.
  • config (dict) – User configuration for this component.

Inheritance

Inheritance diagram of Component

declare_config(config)

Declare the configuration options of this component.

Parameters
config (flowbber.config.Configurator) – The configuration manager for this component.
id

Component unique identifier.

index

Index of this component in the stage.

join()

Join the component and get its execution information.

Returns
The execution information of this component.
Return type
ExecutionInfo.
optional

Component successful execution is optional or not.

start(*args)

Start the component execution.

stop()

Force stop this component.

Use only when the result of the source is not longer relevant.

timeout

Timeout for this component.

Exceptions

  • TimeExceededError: Exception raised when a component execution time was exceeded.
  • CrashError: Exception raised when a component crashed.
exception flowbber.components.base.TimeExceededError(execution)

Exception raised when a component execution time was exceeded.

Inheritance

Inheritance diagram of TimeExceededError

exception flowbber.components.base.CrashError(execution)

Exception raised when a component crashed.

Inheritance

Inheritance diagram of CrashError