> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

# messaging

# `prefect.server.events.messaging`

## Functions

### `publish` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/messaging.py#L19](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/messaging.py#L19)</sup>

```python theme={null}
publish(events: Iterable[ReceivedEvent]) -> None
```

Send the given events as a batch via the default publisher

### `create_event_publisher` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/messaging.py#L79](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/messaging.py#L79)</sup>

```python theme={null}
create_event_publisher() -> EventPublisher
```

### `create_actions_publisher` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/messaging.py#L84](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/messaging.py#L84)</sup>

```python theme={null}
create_actions_publisher() -> Publisher
```

## Classes

### `EventPublisher` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/messaging.py#L26](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/messaging.py#L26)</sup>

**Methods:**

#### `publish_data` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/messaging.py#L41](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/messaging.py#L41)</sup>

```python theme={null}
publish_data(self, data: bytes, attributes: Mapping[str, str]) -> None
```

#### `publish_data` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/utilities/messaging/\_\_init\_\_.py#L68](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/utilities/messaging/__init__.py#L68)</sup>

```python theme={null}
publish_data(self, data: bytes, attributes: Mapping[str, str]) -> None
```

#### `publish_event` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/messaging.py#L44](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/events/messaging.py#L44)</sup>

```python theme={null}
publish_event(self, event: ReceivedEvent) -> None
```

Publishes the given events

**Args:**

* `event`: the event to publish
