## protocols.eventpub.EventPublisherProtocol

<span id="hexkit.protocols.eventpub.EventPublisherProtocol"></span>


A protocol for publishing events to an event broker.


Usage

``` python
protocols.eventpub.EventPublisherProtocol()
```


## Methods

| Name | Description |
|----|----|
| [publish()](#publish) | Publish an event. |

<span id="hexkit.protocols.eventpub.EventPublisherProtocol.publish"></span>


#### publish()


Publish an event.


Usage

``` python
publish(*, payload, type_, key, topic, event_id=None, headers=None)
```


Args: - `payload` (JSON): The payload to ship with the event. - `type_` (str): The event type. ASCII characters only. - `key` (str): The event type. ASCII characters only. - `topic` (str): The event type. ASCII characters only. - `event_id` (UUID4, optional): An optional event ID. If not provided, a new one will be generated. - `headers`: Additional headers to attach to the event.
