Skip to content

Commit 9b89fe4

Browse files
committed
documentation: add description of the session identification
Part of #85
1 parent d88af97 commit 9b89fe4

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)
@@ -370,6 +371,20 @@ Available `options`:
370371
`ttr` - time to release in seconds. The time after which, if there is no active
371372
connection in the session, it will be released with all its tasks.
372373

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

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

0 commit comments

Comments
 (0)