add to expiring set
This block is part of the realtime group and was last modified in core v15.0.2.
add to expiring set v15.0.2 Adds a member to an expiring set, held by the running socket (until it closes, then for linger_ms) or for ttl_ms: a device that stays online while its connection does, a worker that stays in a pool while it is connected.
- flow
- set
valuerequired - member
valueDefaults to the user of the run's socket.
- hold
value"socket" (the default on a socket run) or "ttl". • Suggestions:
socketttl - ttl ms
numberHow long a "ttl" hold lasts.
- linger ms
numberHow long the member stays after its last socket hold goes; 0 leaves at once.
- data
objectStored with the member; members and the trigger return it.
- flow
- success
condition - joined
condition - error
value
hold "socket" (the default when the run has a socket: a socket method or socket trigger) keeps the member while the run's socket holds it; the socket's node renews the hold, its close releases it, and if the node dies the sweeper releases it within about 15 s. A member several sockets hold (on any node) is one member; it leaves when its last hold goes and linger_ms passes with no socket holding it again (0 leaves at once), which absorbs a reconnect. hold "ttl" (the default without a socket) keeps it for ttl_ms, the same as liveset_touch. member defaults to the run's socket's user. data replaces the object stored with the member (left unset, the stored one is kept). joined is true only when this call made it a member; the trigger_liveset_change for the set runs then, with reason "added". success=false with error NO_SOCKET, NO_MEMBER, TTL_REQUIRED, BAD_HOLD or LIVESET_NOT_ENABLED (a node with no realtime layer).
Version history
Introduced in v15.0.2.
v15.0.2: block added in this release.
Back to
realtime Return to the main group to view all sub-groups Back to expiring sets Return to the group to view all blocks within this group