event_handler_connection

Module: Event Handling

The interface that exposes a connection to the handler. The interface is created for each subscribed event.

#include <event_handling.h>

Public Functions

Name
virtual~event_handler_connection()
The destructor of the handler connection that does not disconnect the handler.
virtual async_result< void >disconnect() =0
Disconnects a handler to unsubscribe from the subscribed event.
class dolbyio::comms::event_handler_connection;

Public Functions Documentation

function ~event_handler_connection

virtual ~event_handler_connection()

The destructor of the handler connection that does not disconnect the handler.

function disconnect

virtual async_result< void > disconnect() =0

Disconnects a handler to unsubscribe from the subscribed event.

Return: The result object producing the operation status asynchronously.

Attention: This function is asynchronous and the operation is executed on the event loop of the SDK. You can either block the calling thread until the operation completes or chain consecutive operations that depend on the completion of this method using the async_result::then call. The async_result chain operations need to be terminated with an async_result::on_error.

// Wait for the operation to complete
wait(handler->disconnect());

// Continue in the `then` call
handler->disconnect()
  .then([]() {
    // the handler is disconnected
  })
  .on_error([](auto&& e) {
    // handle the disconnect error
  });


Did this page help you?