beta
cables is under heavy development.
There might be one or another bug, please let us know about it!
SocketClusterTopicInfo
Ops.Net.SocketCluster.SocketClusterTopicInfo
get info for clients listening on a socketcluster topic

summary (oneliner)

Socket Cluster Topic Info gives you information about active clients that are subscribed to a topic.

"active" is defined by the "timeout" parameter, clients that didn't send a message for longer than the timeout will be considered inactive.

after the "soft timeout" clients will be moved to the soft timeout list (and kept in active) until they either reach the full timeout and are deemed inactive or send another message.

if a client has been considered inactive and then sends a new message, it will be moved from the inactive state to active again.

updates and checks happen on every message received and can be manually triggered by the "update" trigger. please be advised that most of this runs asynchronously, so (i.e.) do not count on the timeout progress ending at 1 exactly (might be lower).

the own client appears in NONE of these lists.

doc

issues

youtube id

collections

related ops

Inputs

Socket (Object)

the socketcluster socket


Topic (String)

name of the topic


Timeout (integer /Number)

timeout in ms


Soft Timeout (integer /Number)

soft timeout in ms (should be smaller than timeout)


Retain Messages (integer /Number)

retain x messages of every client, keep this small (but not 0)


Update (Trigger)

trigger updates


Outputs

Active Clients (Array)

array of active client ids


Will Time Out (Object)

object of clients that will timeout soon, if they do not send a new message. provides lastmessage timestamp, when it will timeout and a progress to the timeout from 0 to 1


Timed Out Clients (Array)

former clients that are not active anymore


Messages (Object)

object of retained messages for every client, with the clientid as a key


Updated (Trigger)

triggers on update of any of the above lists


Caught a mistake or want to contribute to the documentation?

Edit Documentationcancel save
SocketCluster example:


Credits


Changelog


created op
2021-05-06 - stephan

Ops.User.stephan.SocketClusterTopicInfo renamed to Ops.Net.SocketCluster.SocketClusterTopicInfo
2021-05-06 - stephan

Examples using SocketClusterTopicInfo

Public Patches using SocketClusterTopicInfo