# PendingInvocationRegistry API

Registry for command invocations awaiting correlated responses.

---
Canonical: /handbook/api/classes/_purista_core.PendingInvocationRegistry/
Source: core/EventBridge/PendingInvocationRegistry.impl.ts
Format: Markdown for agents
---

Registry for command invocations awaiting correlated responses.

Package: `@purista/core`

## Signature

```typescript
class PendingInvocationRegistry<T>
```

## Members

### Constructors

- `new constructor<T>(options: { onLateResponse: (correlationId: string) => void; retentionMs: number })`

### Accessors

- `size`

### Methods

- `clear(): void` — Clear pending and timed-out entries without resolving callers.
- `getPendingMap(): Map<string, PendingInvocation<T>>` — Exposes the pending map for low-level bridge diagnostics.
- `register(correlationId: string, timeoutMs: number, traceId: string | undefined): Promise<T>` — Register one invocation and reject it automatically after `timeoutMs`.
- `reject(correlationId: string, error: unknown): "rejected" | "late" | "missing"` — Reject a pending invocation or classify the response as late/missing.
- `rejectAll(error: unknown): void` — Reject all pending invocations, typically during bridge shutdown.
- `resolve(correlationId: string, payload: T): "late" | "missing" | "resolved"` — Resolve a pending invocation or classify the response as late/missing.
