# Path: aioreactive/notification.py
# class Notification(Generic[TSource], ABC):
#     """Represents a message to a mailbox processor."""
# 
#     def __init__(self, kind: MsgKind):
#         self.kind = kind  # Message kind
# 
#     @abstractmethod
#     async def accept(
#         self,
#         asend: Callable[[TSource], Awaitable[None]],
#         athrow: Callable[[Exception], Awaitable[None]],
#         aclose: Callable[[], Awaitable[None]],
#     ) -> None:
#         raise NotImplementedError
# 
#     @abstractmethod
#     async def accept_observer(self, obv: AsyncObserver[TSource]) -> None:
#         raise NotImplementedError
# 
#     def __repr__(self) -> str:
#         return str(self)
# 
# Path: aioreactive/types.py
# class AsyncObservable(Generic[T_co]):
#     __slots__ = ()
# 
#     @abstractmethod
#     async def subscribe_async(self, observer: AsyncObserver[T_co]) -> AsyncDisposable:
#         raise NotImplementedError


from abc import ABC
from dataclasses import dataclass
from typing import Any, Iterable, NewType, TypeVar, get_origin
from expression.core import SupportsMatch
from expression.system import AsyncDisposable
from .notification import Notification
from .types import AsyncObservable
"""Internal messages used by mailbox processors. Do not import or use.
"""



TSource = TypeVar("TSource")
TOther = TypeVar("TOther")

Key = NewType("Key", int)


class Msg(SupportsMatch[TSource], ABC):
    """Message base class."""


@dataclass
class SourceMsg(Msg[Notification[TSource]], SupportsMatch[TSource]):

# Path: aioreactive/notification.py
# class Notification(Generic[TSource], ABC):
#     """Represents a message to a mailbox processor."""
# 
#     def __init__(self, kind: MsgKind):
#         self.kind = kind  # Message kind
# 
#     @abstractmethod
#     async def accept(
#         self,
#         asend: Callable[[TSource], Awaitable[None]],
#         athrow: Callable[[Exception], Awaitable[None]],
#         aclose: Callable[[], Awaitable[None]],
#     ) -> None:
#         raise NotImplementedError
# 
#     @abstractmethod
#     async def accept_observer(self, obv: AsyncObserver[TSource]) -> None:
#         raise NotImplementedError
# 
#     def __repr__(self) -> str:
#         return str(self)
# 
# Path: aioreactive/types.py
# class AsyncObservable(Generic[T_co]):
#     __slots__ = ()
# 
#     @abstractmethod
#     async def subscribe_async(self, observer: AsyncObserver[T_co]) -> AsyncDisposable:
#         raise NotImplementedError


# Path: aioreactive/msg.py
from abc import ABC
from dataclasses import dataclass
from typing import Any, Iterable, NewType, TypeVar, get_origin
from expression.core import SupportsMatch
from expression.system import AsyncDisposable
from .notification import Notification
from .types import AsyncObservable

"""Internal messages used by mailbox processors. Do not import or use.
"""



TSource = TypeVar("TSource")
TOther = TypeVar("TOther")

Key = NewType("Key", int)


class Msg(SupportsMatch[TSource], ABC):
    """Message base class."""


@dataclass
class SourceMsg(Msg[Notification[TSource]], SupportsMatch[TSource]):

    value: Notification[TSource]