Tarantool CE/EE Documentation portal logo
Support
Updated at July 17, 2026   02:08 PM

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

Returns

the key value

To read more about watchers, see the box-watchers section.

Example:

-- Broadcast value 42 for the 'foo' key.box.broadcast('foo', 42)-- Get the value of this keytarantool> box.watch_once('foo')---- 42...-- Non-existent keys' values are emptytarantool> box.watch_once('none')---...