summaryrefslogtreecommitdiff
path: root/src/apscheduler/eventbrokers/local.py
blob: 27a3cfd9beed77e99e0fc54e48c342ecfa5b1789 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from __future__ import annotations

import attrs

from .._events import Event
from .base import BaseEventBroker


@attrs.define(eq=False)
class LocalEventBroker(BaseEventBroker):
    """
    Asynchronous, local event broker.

    This event broker only broadcasts within the process it runs in, and is therefore
    not suitable for multi-node or multiprocess use cases.

    Does not serialize events.
    """

    async def publish(self, event: Event) -> None:
        await self.publish_local(event)