Skip to main content

Class: AbstractClusterProvider<CustomEvents>

Type parameters

NameType
CustomEventsextends string | void = void

Constructors

constructor

new AbstractClusterProvider<CustomEvents>(clusterConfig): AbstractClusterProvider<CustomEvents>

Type parameters

NameType
CustomEventsextends string | void = void

Parameters

NameType
clusterConfigClusterConfig

Returns

AbstractClusterProvider<CustomEvents>

Defined in

packages/backend/server/src/cluster/abstract-cluster-provider.ts:44

Properties

clusterConfig

Protected clusterConfig: ClusterConfig

Defined in

packages/backend/server/src/cluster/abstract-cluster-provider.ts:39

Methods

addListener

addListener(event, listener): void

Parameters

NameType
eventAllEvents<CustomEvents>
listenerListener

Returns

void

Defined in

packages/backend/server/src/cluster/abstract-cluster-provider.ts:61


connectOrThrow

connectOrThrow(): Promise<true>

Returns

Promise<true>

Defined in

packages/backend/server/src/cluster/abstract-cluster-provider.ts:57


disconnect

disconnect(): Promise<boolean>

Returns

Promise<boolean>

Defined in

packages/backend/server/src/cluster/abstract-cluster-provider.ts:59


emitEvent

emitEvent(event, ...args): void

Parameters

NameType
eventAllEvents<CustomEvents>
...argsunknown[]

Returns

void

Defined in

packages/backend/server/src/cluster/abstract-cluster-provider.ts:71


get

get(key): Promise<null | string>

Parameters

NameType
keystring

Returns

Promise<null | string>

Defined in

packages/backend/server/src/cluster/abstract-cluster-provider.ts:162


getObject

getObject<T>(key): Promise<null | T>

Type parameters

Name
T

Parameters

NameType
keystring

Returns

Promise<null | T>

Defined in

packages/backend/server/src/cluster/abstract-cluster-provider.ts:147


handlePublish

handlePublish(channel, message): Promise<boolean>

Parameters

NameType
channelstring
messagestring

Returns

Promise<boolean>

Defined in

packages/backend/server/src/cluster/abstract-cluster-provider.ts:161


handleSubscribe

handleSubscribe(channel, listener): Promise<boolean>

Parameters

NameType
channelstring
listenerListener

Returns

Promise<boolean>

Defined in

packages/backend/server/src/cluster/abstract-cluster-provider.ts:160


handleUnsubscribe

handleUnsubscribe(channel, listener): Promise<boolean>

Parameters

NameType
channelstring
listenerListener

Returns

Promise<boolean>

Defined in

packages/backend/server/src/cluster/abstract-cluster-provider.ts:159


isConnected

isConnected(isSubscriber): boolean

Parameters

NameType
isSubscriberboolean

Returns

boolean

Defined in

packages/backend/server/src/cluster/abstract-cluster-provider.ts:58


lock

lock(lockOptions, force?): Promise<boolean>

Parameters

NameType
lockOptionsLockOptions
force?boolean

Returns

Promise<boolean>

Defined in

packages/backend/server/src/cluster/abstract-cluster-provider.ts:165


publish

publish<T>(channel, message): Promise<boolean>

Type parameters

NameType
Tunknown

Parameters

NameType
channelstring
messageT

Returns

Promise<boolean>

Defined in

packages/backend/server/src/cluster/abstract-cluster-provider.ts:76


remove

remove(key): Promise<boolean>

Parameters

NameType
keystring

Returns

Promise<boolean>

Defined in

packages/backend/server/src/cluster/abstract-cluster-provider.ts:164


removeListener

removeListener(event, listener): void

Parameters

NameType
eventAllEvents<CustomEvents>
listenerListener

Returns

void

Defined in

packages/backend/server/src/cluster/abstract-cluster-provider.ts:66


store

store(key, value, ttl, lockKey?): Promise<boolean>

Parameters

NameType
keystring
valuestring | number | Buffer
ttlnull | number
lockKey?string

Returns

Promise<boolean>

Defined in

packages/backend/server/src/cluster/abstract-cluster-provider.ts:163


storeObject

storeObject(key, value, ttl, lockKey?): Promise<boolean>

Parameters

NameType
keystring
valueRecord<never, unknown>
ttlnull | number
lockKey?string

Returns

Promise<boolean>

Defined in

packages/backend/server/src/cluster/abstract-cluster-provider.ts:154


subscribe

subscribe(channel, listener, ignoreOwnMessages?): Promise<boolean>

Parameters

NameTypeDefault value
channelstringundefined
listenerSubscriberListenerundefined
ignoreOwnMessagesbooleanfalse

Returns

Promise<boolean>

Defined in

packages/backend/server/src/cluster/abstract-cluster-provider.ts:91


unlock

unlock(lockOptions, force?): Promise<boolean>

Parameters

NameType
lockOptionsLockOptions
force?boolean

Returns

Promise<boolean>

Defined in

packages/backend/server/src/cluster/abstract-cluster-provider.ts:166


unsubscribe

unsubscribe(channel, listener, silently?): Promise<boolean>

Parameters

NameTypeDefault value
channelstringundefined
listenerSubscriberListenerundefined
silentlybooleanfalse

Returns

Promise<boolean>

Defined in

packages/backend/server/src/cluster/abstract-cluster-provider.ts:126