box.watch_once()
-
box.
watch_once
(key, func)¶ Returns the current value of a given notification key. The function can be used as an alternative to box.watch() when the caller only needs the current value without subscribing to future changes.
Parameters: - key (
string
) – key name
Return: the key value
To read more about watchers, see the Event watchers section.
Example:
-- Broadcast value 42 for the 'foo' key. box.broadcast('foo', 42) -- Get the value of this key tarantool> box.watch_once('foo') --- - 42 ... -- Non-existent keys' values are empty tarantool> box.watch_once('none') --- ...
- key (