Channels

The functions allowing to receive data in synchronous mode, without a callback

inline std::pair<zenoh::ClosureReplyChannelSend, zenoh::ClosureReplyChannelRecv> zenoh::reply_fifo_new(uintptr_t bound)

Create a new blocking fifo channel.

Parameters:

bound – the maximum number of replies that can be stored in the channel. 0 means unbounded

Returns:

a pair of closures: ClosureReplyChannelSend and ClosureReplyChannelRecv ClosureReplyChannelSend should be passed as callback to a Session::get call ClosureReplyChannelRecv is a synchronous closure to be called from user code. It will block until either a zenoh::Reply is available, which it will then return; or until the ClosureReplyChannelSend closure is dropped and all replies have been consumed, at which point it will return an invalidated zenoh::Reply and so will further calls.

Note

zenoh-c only

inline std::pair<zenoh::ClosureReplyChannelSend, zenoh::ClosureReplyChannelRecv> zenoh::reply_non_blocking_fifo_new(uintptr_t bound)

Create a new non-blocking fifo channel.

Parameters:

bound – the maximum number of replies that can be stored in the channel

Returns:

a pair of closures: ClosureReplyChannelSend and ClosureReplyChannelRecv ClosureReplyChannelSend should be passed as callback to a Session::get call ClosureReplyChannelRecv is a synchronous closure to be called from user code. It will block until either a zenoh::Reply is available, which it will then return; or until the ClosureReplyChannelSend closure is dropped and all replies have been consumed, at which point it will return an invalidated zenoh::Reply and so will further calls.

Note

zenoh-c only