[**Documentation**](../../../README)

***

[Documentation](../../../README) / [@zerotal/notifications](../README) / BroadcastNotificationJob

# Class: BroadcastNotificationJob

Defined in: [notifications/src/BroadcastNotificationJob.ts:12](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/notifications/src/BroadcastNotificationJob.ts#L12)

Delivers one broadcast notification from a queue.

Dispatched only when a `BroadcastMessage` names a queue or connection via
`onQueue()` / `onConnection()`; an unrouted broadcast goes out inline, since
the whole point of the channel is immediacy. Its payload is the resolved wire
data, so it round-trips through a persistent driver without needing the
notification class.

## Extends

- [`Job`](../../queue/index/classes/Job)

## Constructors

### Constructor

> **new BroadcastNotificationJob**(`_channel?`, `_event?`, `_data?`, `queue?`): `BroadcastNotificationJob`

Defined in: [notifications/src/BroadcastNotificationJob.ts:15](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/notifications/src/BroadcastNotificationJob.ts#L15)

#### Parameters

##### \_channel?

`string` = `""`

##### \_event?

`string` = `""`

##### \_data?

`Record`\<`string`, `unknown`\> = `{}`

##### queue?

`string` = `"broadcast"`

#### Returns

`BroadcastNotificationJob`

#### Overrides

[`Job`](../../queue/index/classes/Job).[`constructor`](../../queue/index/classes/Job#constructor)

## Properties

### queue

> `readonly` **queue**: `string`

Defined in: [notifications/src/BroadcastNotificationJob.ts:13](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/notifications/src/BroadcastNotificationJob.ts#L13)

Queue name — override in subclass to route to specific queues

#### Overrides

[`Job`](../../queue/index/classes/Job).[`queue`](../../queue/index/classes/Job#queue)

***

### maxAttempts

> `readonly` **maxAttempts**: `number` = `3`

Defined in: [queue/src/Job.ts:8](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/queue/src/Job.ts#L8)

Max retry attempts before moving to failed queue

#### Inherited from

[`Job`](../../queue/index/classes/Job).[`maxAttempts`](../../queue/index/classes/Job#maxattempts)

***

### retryDelay

> `readonly` **retryDelay**: `number` = `1000`

Defined in: [queue/src/Job.ts:11](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/queue/src/Job.ts#L11)

Milliseconds to wait between retry attempts

#### Inherited from

[`Job`](../../queue/index/classes/Job).[`retryDelay`](../../queue/index/classes/Job#retrydelay)

***

### batchId

> **batchId**: `string` \| `undefined` = `undefined`

Defined in: [queue/src/Job.ts:14](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/queue/src/Job.ts#L14)

Set by Bus.batch() — tracks which batch this job belongs to.

#### Inherited from

[`Job`](../../queue/index/classes/Job).[`batchId`](../../queue/index/classes/Job#batchid)

***

### \_chain

> **\_chain**: [`SerializedJob`](../../queue/index/type-aliases/SerializedJob)[] \| `undefined` = `undefined`

Defined in: [queue/src/Job.ts:17](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/queue/src/Job.ts#L17)

Set by Bus.chain() — remaining jobs to dispatch after this one succeeds.

#### Inherited from

[`Job`](../../queue/index/classes/Job).[`_chain`](../../queue/index/classes/Job#_chain)

## Accessors

### className

#### Get Signature

> **get** **className**(): `string`

Defined in: [queue/src/Job.ts:34](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/queue/src/Job.ts#L34)

The class name used as the serialization key.
Must match what JobRegistry.register() stores.

##### Returns

`string`

#### Inherited from

[`Job`](../../queue/index/classes/Job).[`className`](../../queue/index/classes/Job#classname)

## Methods

### payload()

> **payload**(): `Record`\<`string`, `unknown`\>

Defined in: [notifications/src/BroadcastNotificationJob.ts:25](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/notifications/src/BroadcastNotificationJob.ts#L25)

Serialize job state to a plain object for storage.
Override in subclasses that have constructor arguments.

#### Returns

`Record`\<`string`, `unknown`\>

#### Overrides

[`Job`](../../queue/index/classes/Job).[`payload`](../../queue/index/classes/Job#payload)

***

### fromPayload()

> `static` **fromPayload**(`data`): `BroadcastNotificationJob`

Defined in: [notifications/src/BroadcastNotificationJob.ts:34](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/notifications/src/BroadcastNotificationJob.ts#L34)

#### Parameters

##### data

`Record`\<`string`, `unknown`\>

#### Returns

`BroadcastNotificationJob`

***

### handle()

> **handle**(): `Promise`\<`void`\>

Defined in: [notifications/src/BroadcastNotificationJob.ts:43](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/notifications/src/BroadcastNotificationJob.ts#L43)

The job's work — implement this in every subclass

#### Returns

`Promise`\<`void`\>

#### Overrides

[`Job`](../../queue/index/classes/Job).[`handle`](../../queue/index/classes/Job#handle)
