Skip to content

Commit c94c30b

Browse files
committed
documentation: add description of the session identification
Follows up #85
1 parent f97316e commit c94c30b

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ align="right">
2626
* [Initialization](#initialization)
2727
* [Creating a new queue](#creating-a-new-queue)
2828
* [Set queue settings](#set-queue-settings)
29+
* [Session identification](#session-identification)
2930
* [Putting a task in a queue](#putting-a-task-in-a-queue)
3031
* [Taking a task from the queue ("consuming")](#taking-a-task-from-the-queue-consuming)
3132
* [Acknowledging the completion of a task](#acknowledging-the-completion-of-a-task)
@@ -372,6 +373,20 @@ Available `options`:
372373
`ttr` - time to release in seconds. The time after which, if there is no active
373374
connection in the session, it will be released with all its tasks.
374375

376+
## Session identify
377+
378+
```lua
379+
queue.identify(session_uuid)
380+
```
381+
In the queue the session has a unique UUID and one session can have many
382+
connections. Also, the consumer can reconnect to the existing session during the
383+
`ttr` time.
384+
To get the UUID of the current session, call the `queue.identify()`
385+
without parameters.
386+
To connect to the existing session, call the `queue.identify(session_uuid)`
387+
with the UUID of the session.
388+
In case of failure, an error will be thrown.
389+
375390
## Putting a task in a queue
376391

377392
To insert a new task into a queue, use:

0 commit comments

Comments
 (0)