Skip to content

Add note to README.md: queue.identify() returns string instead of uuid type #182

Closed
@oleg-jukovec

Description

@oleg-jukovec

See:

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:

queue/README.md

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)
```

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentation

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions