-
Notifications
You must be signed in to change notification settings - Fork 55
Closed
Labels
documentationImprovements or additions to documentationImprovements or additions to documentation
Description
See:
queue/queue/abstract/queue_session.lua
Line 195 in 813be24
cur_uuid = uuid.bin() |
https://www.tarantool.io/ru/doc/latest/reference/reference_lua/uuid/#lua-function.uuid.bin
AFAIU it was done for a reason:
#139 (comment)
But it was unexpected for me as a user. I think we need to add a note into the queue.identify()
description:
Lines 466 to 495 in 813be24
## Session identify | |
```lua | |
queue.identify(session_uuid) | |
``` | |
In the queue the session has a unique UUID and many connections may share one | |
logical session. Also, the consumer can reconnect to the existing session during | |
the`ttr` time. | |
To get the UUID of the current session, call the `queue.identify()` | |
without parameters. | |
To connect to the existing session, call the `queue.identify(session_uuid)` | |
with the UUID of the session. | |
In case of attempt to use an invalid format UUID or expired UUID, an error will | |
be thrown. | |
Usage example: | |
Sometimes we need an ability to acknowledge a task after reconnect (because | |
retrying it is undesirable) or even acknowlegde using another connection. | |
Example of code for connecting to the old session in case of reconnection: | |
```lua | |
local netbox = require('net.box') | |
local conn = netbox.connect('localhost:1918', { reconnect_after = 5 }) | |
local session_uuid = conn:call('queue.identify') | |
conn:on_connect(function() | |
conn:call('queue.identify', {session_uuid}) | |
end) | |
``` |
LeonidVas
Metadata
Metadata
Assignees
Labels
documentationImprovements or additions to documentationImprovements or additions to documentation