High performance C++ framework for concurrent servers
Public Member Functions | List of all members
seastar::deferred_close< Object > Class Template Reference

Detailed Description

template<typename Object>
class seastar::deferred_close< Object >

Template helper to auto-close obj when destroyed.

Template Parameters
Objecta class exposing a close() method that returns a future<> that is called when the controller is destroyed.

Must be used in a seastar thread as the destructor needs to wait on the obj close() future.

#include <seastar/util/closeable.hh>

Public Member Functions

 deferred_close (Object &obj) noexcept
 ~deferred_close ()
 Destruct the deferred_close object and auto-close obj.
void close_now () noexcept
 Close obj once now.

Constructor & Destructor Documentation

◆ deferred_close()

template<typename Object >
seastar::deferred_close< Object >::deferred_close ( Object &  obj)

Construct an object that will auto-close obj when destroyed.

Template Parameters
objthe object to auto-close.

The documentation for this class was generated from the following file: