gridflow_python_mediator.behaviors.observability

Logging and timing pipeline behaviors.

Attributes

Classes

LoggingBehavior

Pipeline behavior for logging requests.

TimingBehavior

Pipeline behavior for timing request execution.

Module Contents

gridflow_python_mediator.behaviors.observability.logger
class gridflow_python_mediator.behaviors.observability.LoggingBehavior

Pipeline behavior for logging requests.

Logs request type before and after handler execution.

Example:
>>> mediator.add_pipeline_behavior(
...     LoggingBehavior().handle
... )
async handle(request: Any, next: Callable) Any | None

Log request handling.

Args:

request: Request being handled next: Next handler

Returns:

None (continues to handler)

class gridflow_python_mediator.behaviors.observability.TimingBehavior

Pipeline behavior for timing request execution.

Measures and logs execution duration.

Example:
>>> mediator.add_pipeline_behavior(
...     TimingBehavior().handle
... )
async handle(request: Any, next: Callable) Any | None

Time request handling.

Args:

request: Request being handled next: Next handler

Returns:

Handler result