Class: AbstractClusterProvider<CustomEvents>
Type parameters
Name | Type |
---|---|
CustomEvents | extends string | void = void |
Constructors
constructor
• new AbstractClusterProvider<CustomEvents
>(clusterConfig
): AbstractClusterProvider
<CustomEvents
>
Type parameters
Name | Type |
---|---|
CustomEvents | extends string | void = void |
Parameters
Name | Type |
---|---|
clusterConfig | ClusterConfig |
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
Name | Type |
---|---|
event | AllEvents <CustomEvents > |
listener | Listener |
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
Name | Type |
---|---|
event | AllEvents <CustomEvents > |
...args | unknown [] |
Returns
void
Defined in
packages/backend/server/src/cluster/abstract-cluster-provider.ts:71
get
▸ get(key
): Promise
<null
| string
>
Parameters
Name | Type |
---|---|
key | string |
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
Name | Type |
---|---|
key | string |
Returns
Promise
<null
| T
>
Defined in
packages/backend/server/src/cluster/abstract-cluster-provider.ts:147
handlePublish
▸ handlePublish(channel
, message
): Promise
<boolean
>
Parameters
Name | Type |
---|---|
channel | string |
message | string |
Returns
Promise
<boolean
>
Defined in
packages/backend/server/src/cluster/abstract-cluster-provider.ts:161
handleSubscribe
▸ handleSubscribe(channel
, listener
): Promise
<boolean
>
Parameters
Name | Type |
---|---|
channel | string |
listener | Listener |
Returns
Promise
<boolean
>
Defined in
packages/backend/server/src/cluster/abstract-cluster-provider.ts:160
handleUnsubscribe
▸ handleUnsubscribe(channel
, listener
): Promise
<boolean
>
Parameters
Name | Type |
---|---|
channel | string |
listener | Listener |
Returns
Promise
<boolean
>
Defined in
packages/backend/server/src/cluster/abstract-cluster-provider.ts:159
isConnected
▸ isConnected(isSubscriber
): boolean
Parameters
Name | Type |
---|---|
isSubscriber | boolean |
Returns
boolean
Defined in
packages/backend/server/src/cluster/abstract-cluster-provider.ts:58
lock
▸ lock(lockOptions
, force?
): Promise
<boolean
>
Parameters
Name | Type |
---|---|
lockOptions | LockOptions |
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
Name | Type |
---|---|
T | unknown |
Parameters
Name | Type |
---|---|
channel | string |
message | T |
Returns
Promise
<boolean
>
Defined in
packages/backend/server/src/cluster/abstract-cluster-provider.ts:76
remove
▸ remove(key
): Promise
<boolean
>
Parameters
Name | Type |
---|---|
key | string |
Returns
Promise
<boolean
>
Defined in
packages/backend/server/src/cluster/abstract-cluster-provider.ts:164
removeListener
▸ removeListener(event
, listener
): void
Parameters
Name | Type |
---|---|
event | AllEvents <CustomEvents > |
listener | Listener |
Returns
void
Defined in
packages/backend/server/src/cluster/abstract-cluster-provider.ts:66
store
▸ store(key
, value
, ttl
, lockKey?
): Promise
<boolean
>
Parameters
Name | Type |
---|---|
key | string |
value | string | number | Buffer |
ttl | null | 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
Name | Type |
---|---|
key | string |
value | Record <never , unknown > |
ttl | null | 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
Name | Type | Default value |
---|---|---|
channel | string | undefined |
listener | SubscriberListener | undefined |
ignoreOwnMessages | boolean | false |
Returns
Promise
<boolean
>
Defined in
packages/backend/server/src/cluster/abstract-cluster-provider.ts:91
unlock
▸ unlock(lockOptions
, force?
): Promise
<boolean
>
Parameters
Name | Type |
---|---|
lockOptions | LockOptions |
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
Name | Type | Default value |
---|---|---|
channel | string | undefined |
listener | SubscriberListener | undefined |
silently | boolean | false |
Returns
Promise
<boolean
>
Defined in
packages/backend/server/src/cluster/abstract-cluster-provider.ts:126