<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@empathyco/x-components](./x-components.md) &gt; [XPriorityBus](./x-components.xprioritybus.md)

## XPriorityBus class

A default [XBus](./x-components.xbus.md) implementation using a [priority queue](./x-components.xpriorityqueue.md) as its data structure to prioritise the emission of events. The priorities are preconfigured based on event naming.

**Signature:**

```typescript
export declare class XPriorityBus<SomeEvents extends Dictionary, SomeEventMetadata extends XPriorityBusEventMetadata> implements XBus<SomeEvents, SomeEventMetadata> 
```
**Implements:** [XBus](./x-components.xbus.md)<!-- -->&lt;SomeEvents, SomeEventMetadata&gt;

## Constructors

<table><thead><tr><th>

Constructor


</th><th>

Modifiers


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

[(constructor)(config)](./x-components.xprioritybus._constructor_.md)


</td><td>


</td><td>

Creates a new instance of a [XPriorityBus](./x-components.xprioritybus.md)<!-- -->.


</td></tr>
</tbody></table>

## Methods

<table><thead><tr><th>

Method


</th><th>

Modifiers


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

[emit(event, payload, metadata)](./x-components.xprioritybus.emit.md)


</td><td>


</td><td>

Emits an event. See [XBus.emit](./x-components.xbus.emit.md)<!-- -->.


</td></tr>
<tr><td>

[on(event, withMetadata)](./x-components.xprioritybus.on.md)


</td><td>


</td><td>

Retrieves an observable for the event. See [XBus.on](./x-components.xbus.on.md)<!-- -->.


</td></tr>
</tbody></table>

