CallbackWithOptions

class passengersim.callbacks.base.CallbackWithOptions(func: Callable, *, priority: int | None = None, skip_burn: bool | None = None, name: str | None = None)[source]

Bases: object

A plain callback registered with keyword options.

Registering a function with options such as priority or name stores the function inside one of these, rather than setting attributes on the function itself, so the same function can be registered elsewhere with different options. An option left as None falls back to the function’s own attribute of the same name, if it has one.

Methods

__init__(func, *[, priority, skip_burn, name])

Attributes

result_name

Key under which returned dictionaries are stored, instead of the hook name.

priority

The offset in seconds for a queued hook, read when events are scheduled.

skip_burn

Whether the callback is skipped during burn-in samples.

result_name

Key under which returned dictionaries are stored, instead of the hook name.

property priority : Any

The offset in seconds for a queued hook, read when events are scheduled.

property skip_burn : bool

Whether the callback is skipped during burn-in samples.