Skip to main content

@dialstack/sdk-dev / server/src / ParkSlotSubscriptionHandlers

Interface: ParkSlotSubscriptionHandlers

Defined in: sdk/server/src/index.ts:2786

Handlers for a park-slot subscription. All optional.

Properties​

onError?​

TypeScript
optional onError?: (error) => void;

Defined in: sdk/server/src/index.ts:2806

Transport, refusal or parse failure. The subscription reconnects on backoff, except after a DialStackAuthenticationError (401) or DialStackPermissionError (403): a rejected credential does not recover on retry, so the subscription stops and is no longer live.

Parameters​

error​

Error

Returns​

void


onSlot?​

TypeScript
optional onSlot?: (slot) => void;

Defined in: sdk/server/src/index.ts:2793

One slot's new state. It supersedes what you had; there is no history.

Parameters​

slot​

ParkSlotPresence

Returns​

void


onSnapshot?​

TypeScript
optional onSnapshot?: (slots) => void;

Defined in: sdk/server/src/index.ts:2791

Every slot's current state, delivered on connect and again after every reconnect. Replace whatever you had wholesale rather than merging.

Parameters​

slots​

ParkSlotPresence[]

Returns​

void


onTerminated?​

TypeScript
optional onTerminated?: (reason) => void;

Defined in: sdk/server/src/index.ts:2799

The server ended the subscription and a reconnect is needed — reason is why. Recovery is the same in every case: reconnect and take the fresh snapshot. Not called when you close the subscription yourself.

Parameters​

reason​

string

Returns​

void