event

Functions

context

Get a context manager and results for all hooks of the annotated type.

execution

Configure an execution hook.

retry

Configure a retry hook.

submission

Configure a submission hook.

laminar.configurations.hooks.event.context(*, layer: Layer, annotation: str) ExitStack

Get a context manager and results for all hooks of the annotated type.

Parameters
layer: Layer

Layer the hooks are for.

annotation: str

Annotation to get hooks for.

Returns

A context manager with all annotated hooks activated.

laminar.configurations.hooks.event.execution(hook: T) T

Configure an execution hook.

Usage:

from laminar.configurations import hooks

@hooks.execution
def configure() -> Generator[None, None, None]:
    ...
laminar.configurations.hooks.event.retry(hook: T) T

Configure a retry hook.

Usage:

from laminar.configurations import hooks

@hooks.retry
def configure() -> Generator[None, None, None]:
    ...
laminar.configurations.hooks.event.submission(hook: T) T

Configure a submission hook.

Usage:

from laminar.configurations import hooks

@hooks.submission
def configure() -> Generator[None, None, None]:
    ...