Skip to content

Migration event

mongorunway.domain.migration_event ¤

EventHandler: typing.TypeAlias = typing.Callable[['MigrationEvent'], None] module-attribute ¤

EventHandlerProxyOr: typing.TypeAlias = typing.Union[EventHandlerT, 'EventHandlerProxy'] module-attribute ¤

EventHandlerT = typing.TypeVar('EventHandlerT', bound=EventHandler) module-attribute ¤

__all__: typing.Sequence[str] = ('EventHandler', 'EventHandlerProxy', 'EventHandlerProxyOr', 'EventHandlerT', 'StartingEvent', 'ClosingEvent', 'ApplicationEvent', 'MigrationEvent') module-attribute ¤

ApplicationEvent ¤

Bases: MigrationEvent

Source code in mongorunway\domain\migration_event.py
@attr.define
class ApplicationEvent(MigrationEvent):
    application: applications.MigrationApp = attr.field()

application: applications.MigrationApp = attr.field() instance-attribute class-attribute ¤

ClosingEvent ¤

Bases: ApplicationEvent

Source code in mongorunway\domain\migration_event.py
@attr.define
class ClosingEvent(ApplicationEvent):
    pass

EventHandlerProxy ¤

Source code in mongorunway\domain\migration_event.py
@attr.define(eq=True, order=True, hash=True)
class EventHandlerProxy:
    _priority: int = attr.field(
        eq=True,
        hash=True,
        alias="priority",
    )  # type: ignore[call-overload]

    _handler: EventHandler = attr.field(
        eq=False,
        hash=False,
        alias="handler",
    )  # type: ignore[call-overload]

    @property
    def priority(self) -> int:
        return self._priority

    @property
    def handler(self) -> EventHandler:
        return self._handler

    def __call__(self, *args: typing.Any, **kwargs: typing.Any) -> None:
        self._handler(*args, **kwargs)

handler: EventHandler property ¤

priority: int property ¤

__call__(*args, **kwargs) ¤

Source code in mongorunway\domain\migration_event.py
def __call__(self, *args: typing.Any, **kwargs: typing.Any) -> None:
    self._handler(*args, **kwargs)

MigrationEvent ¤

Source code in mongorunway\domain\migration_event.py
@attr.define
class MigrationEvent:
    pass

StartingEvent ¤

Bases: ApplicationEvent

Source code in mongorunway\domain\migration_event.py
@attr.define
class StartingEvent(ApplicationEvent):
    pass