boost::redis::basic_connection::async_receive

(Deprecated) Receives server side pushes asynchronously.

Synopsis

template<class CompletionToken = asio::default_completion_token_t<executor_type>>
auto
async_receive(CompletionToken&& token = {});

Description

When pushes arrive and there is no async_receive operation in progress, pushed data, requests, and responses will be paused until async_receive is called again. Apps will usually want to call async_receive in a loop.

For an example see cpp20_subscriber.cpp. The completion token must have the following signature

void f(system::error_code, std::size_t);

Where the second parameter is the size of the push received in bytes.

Per‐operation cancellation

This operation supports the following cancellation types:

  • `asio::cancellation_type_t::terminal`.

  • `asio::cancellation_type_t::partial`.

  • `asio::cancellation_type_t::total`.

Calling basic_connection::cancel(operation::receive) will also cancel any ongoing receive operations.

Parameters

Name Description

token

Completion token.

Created with MrDocs