---
title: "add to expiring set · RUAL Documentation"
description: "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 c…"
canonical: https://docs.rual.nl/block-types/realtime/liveset_add
language: en
---

# add to expiring set

This block is part of the [`realtime`](https://docs.rual.nl/block-types/realtime) group and was last modified in core [`v15.0.2`](https://docs.rual.nl/core-versions/150002).

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 `value` required

- member `value` Defaults to the user of the run's socket.

- hold `value` "socket" (the default on a socket run) or "ttl". • Suggestions: `socket` `ttl`

- ttl ms `number` How long a "ttl" hold lasts.

- linger ms `number` How long the member stays after its last socket hold goes; 0 leaves at once.

- data `object` Stored 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`](https://docs.rual.nl/core-versions/150002).

- [`v15.0.2`](https://docs.rual.nl/core-versions/150002): block added in this release.

- [Back to `realtime`](https://docs.rual.nl/block-types/realtime): Return to the main group to view all sub-groups

- [Back to `expiring sets`](https://docs.rual.nl/block-types/realtime?group=expiring%20sets): Return to the group to view all blocks within this group
