# PmeGateway

**Kind:** Class

**Source:** [`atloria-monorepo/apps/api/src/pme/pme.gateway.ts`](https://github.com/sherkety/atloria/blob/main/atloria-monorepo/apps/api/src/pme/pme.gateway.ts#L31)

**Implements:** `OnGatewayConnection`, `OnGatewayDisconnect`

## Methods

| Method | Signature | Returns |
|---|---|---|
| `handleConnection` | `handleConnection(client: Socket)` | `void` |
| `handleDisconnect` | `handleDisconnect(client: Socket)` | `void` |
| `handleSubscribe` | `handleSubscribe(client: Socket, data: { jobId: string })` | `void` |
| `handleUnsubscribe` | `handleUnsubscribe(client: Socket, data: { jobId: string })` | `void` |
| `emitProgress` | `emitProgress(event: PmeProgressEvent)` | `void` |
| `emitCompleted` | `emitCompleted(event: PmeCompletedEvent)` | `void` |
| `emitFailed` | `emitFailed(event: PmeFailedEvent)` | `void` |
| `hasSubscribers` | `hasSubscribers(jobId: string)` | `boolean` |
| `getSubscriberCount` | `getSubscriberCount(jobId: string)` | `number` |

## Properties

| Property | Type |
|---|---|
| `server` | `Server` |

## Where it refuses work

- `PmeGateway` stops the work with an early return when `!jobId`, in 2 places.

## Referenced By

- `PmeModule` (MODULE_PROVIDES)
- `PmeModule` (MODULE_EXPORTS)
