SocketClusterTopicInfo Op
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.
- Ops.Extension.SocketCluster.SocketClusterTopicInfo
- Extension Op - Visible to all users
- MIT
Documentation (markdown)
Issues
Example patch id
Youtube ids (comma seperated)
Op Licence
Caniuse query
Example Patch socketcluster example
open this page in another browser or share the url of this patch!
INPUT PORTS
the socketcluster socket
name of the topic
timeout in ms
soft timeout in ms (should be smaller than timeout)
retain x messages of every client, keep this small (but not 0)
trigger updates
OUTPUT PORTS
array of active client ids
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
former clients that are not active anymore
object of retained messages for every client, with the clientid as a key
triggers on update of any of the above lists
Patches using SocketClusterTopicInfo
Changelog
created op | stephan - 2021-05-06 09:29 | |
Ops.User.stephan.SocketClusterTopicInfo renamed to Ops.Net.SocketCluster.SocketClusterTopicInfo | stephan - 2021-05-06 12:01 | |
Ops.Net.SocketCluster.SocketClusterTopicInfo renamed to Ops.Extension.SocketCluster.SocketClusterTopicInfo | stephan - 2022-12-14 08:37 | |
Added toggle to receive my own data | pandur - 2024-04-15 13:41 |