static/jsvm/interfaces/subscriptions.Client.html
Client is an interface for a generic subscription client.
channeldiscardgethasSubscriptionidisDiscardedsendsetsubscribesubscriptionsunsetunsubscribe
Channel returns the client's communication channel.
NB! The channel shouldn't be used after calling Discard().
Discard marks the client as "discarded" (and closes its channel), meaning that it shouldn't be used anymore for sending new messages.
It is safe to call Discard() multiple times.
Get retrieves the key value from the client's context.
HasSubscription checks if the client is subscribed to sub.
Id Returns the unique id of the client.
IsDiscarded indicates whether the client has been "discarded" and should no longer be used.
Send sends the specified message to the client's channel (if not discarded).
Set stores any value to the client's context.
Subscribe subscribes the client to the provided subscriptions list.
Each subscription can also have "options" (json serialized SubscriptionOptions) as query parameter.
Example:
Subscribe( "subscriptionA", `subscriptionB?options={"query":{"a":1},"headers":{"x_token":"abc"}}`, )Copy
Rest ...subs: string[]Subscriptions returns a shallow copy of the client subscriptions matching the prefixes. If no prefix is specified, returns all subscriptions.
Rest ...prefixes: string[]Unset removes a single value from the client's context.
Unsubscribe unsubscribes the client from the provided subscriptions list.
Rest ...subs: string[]OSLightDark
Generated using TypeDoc