Skip to content

Document box.watch_once() #3510

@TarantoolBot

Description

@TarantoolBot

Product: Tarantool
Since: 3.0
Root document: https://www.tarantool.io/en/doc/latest/reference/reference_lua/box_events/
SME: @ locker

Details

The function takes a notification key and returns the value currently
associated with it.

tarantool> box.watch_once('foo')
---
...

tarantool> box.broadcast('foo', {a = 1, b = 2})
---
...

tarantool> box.watch_once('foo')
---
- {'a': 1, 'b': 2}
...

The new function can be used instead of box.watch() in case the caller
only needs to retrieve the current value without subscribing to future
changes.
Requested by @locker in tarantool/tarantool@f899bb6.

Metadata

Metadata

Assignees

Labels

3.0featureA new functionalityreference[location] Tarantool manual, Reference part

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions