<filename>drain/types.py<gh_stars>0
"""
drain.types.py
~~~~~~~~~~~~~~

Contains custom types definitions and utilities
"""
from .record import Record
from typing import (
    Awaitable,
    AsyncIterable,
    Callable,
    Union,
    TypeVar,
)

RecordT = TypeVar("RecordT", bound=Record)

Source = AsyncIterable[RecordT]
Processor = Union[
    Callable[[RecordT], RecordT], Callable[[RecordT], Awaitable[RecordT]]
]
Predicate = Callable[[RecordT], bool]

<filename>drain/types.py<gh_stars>0
"""
drain.types.py
~~~~~~~~~~~~~~

Contains custom types definitions and utilities
"""
from .record import Record
from typing import (
    Awaitable,
    AsyncIterable,
    Callable,
    Union,
    TypeVar,
)

RecordT = TypeVar("RecordT", bound=Record)

Source = AsyncIterable[RecordT]
Processor = Union[
    Callable[[RecordT], RecordT], Callable[[RecordT], Awaitable[RecordT]]
]
Predicate = Callable[[RecordT], bool]

drain.types.py ~~~~~~~~~~~~~~  Contains custom types definitions and utilities