---
title: "subscribe · RUAL Documentation"
description: "Adds rooms to a socket's session, a session or every session of a user, on any node. A RUAL realtime block. See its pins and version history."
canonical: https://docs.rual.nl/block-types/realtime/realtime_subscribe
language: en
---

# subscribe

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 rooms to a socket's session, a session or every session of a user, on any node.

- flow

- rooms `array`

- room `value`

- group `value`

- max `number`

- session `value` A session id. Without session or user: the socket of the run.

- user `value` A user guid: every session of the user, on any node.

- flow

- success `condition`

- joined seq `number`

- evicted `array`

- error `value`

Writes the rooms into each target session in Redis with the current seq as the joined seq (a resume never replays a room's past from before the join), and tells the nodes holding the sockets. On the run's own socket the join is done before the block returns. group and max keep a per-session LRU of rooms in the group and report the room they evicted (e.g. the 10 most recently opened rooms of each board, project or server a client browses).

## 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 `realtime`](https://docs.rual.nl/block-types/realtime?group=realtime): Return to the group to view all blocks within this group
