# Interface IEventBus

Event bus interface — fire-and-forget event emission with typed subscriptions and bounded query.

interface IEventBus {
emit(event: PipelineEvent): void;
subscribe(filter: EventFilter, handler: EventHandler): Unsubscribe;
query(filter: EventFilter, limit?: number): readonly PipelineEvent[];
totalEmitted: number;
bufferSize: number;
}

#### Implemented by

- EventBus

- Defined in packages/nexus-agents/src/pipeline/event-types.ts:274

##### Index

### Properties

totalEmitted
bufferSize

### Methods

emit
subscribe
query

## Properties

### `Readonly` totalEmitted

totalEmitted: number

Total events emitted (including evicted).

- Defined in packages/nexus-agents/src/pipeline/event-types.ts:285

### `Readonly` bufferSize

bufferSize: number

Current buffer size.

- Defined in packages/nexus-agents/src/pipeline/event-types.ts:288

## Methods

### emit

- emit(event: PipelineEvent): void

  Emit an event. Handlers must not throw.

  #### Parameters

  - event: PipelineEvent

  #### Returns void

  - Defined in packages/nexus-agents/src/pipeline/event-types.ts:276

### subscribe

- subscribe(filter: EventFilter, handler: EventHandler): Unsubscribe

  Subscribe to events matching filter. Returns unsubscribe function.

  #### Parameters

  - filter: EventFilter
  - handler: EventHandler

  #### Returns Unsubscribe

  - Defined in packages/nexus-agents/src/pipeline/event-types.ts:279

### query

- query(filter: EventFilter, limit?: number): readonly PipelineEvent[]

  Query recent events (bounded buffer).

  #### Parameters

  - filter: EventFilter
  - `Optional` limit: number

  #### Returns readonly PipelineEvent[]

  - Defined in packages/nexus-agents/src/pipeline/event-types.ts:282