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

Detailed Description

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

Template helper to auto-stop obj when destroyed.

Template Parameters
Objecta class exposing a stop() 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 stop() future.

Examples
sharded_parameter_demo.cc.

#include <seastar/util/closeable.hh>

Public Member Functions

 deferred_stop (Object &obj) noexcept
 
 ~deferred_stop ()
 Destruct the deferred_stop object and auto-stop obj.
 
void stop_now () noexcept
 Stop obj once now.
 

Constructor & Destructor Documentation

◆ deferred_stop()

template<typename Object >
seastar::deferred_stop< Object >::deferred_stop ( Object &  obj)
inlinenoexcept

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

Template Parameters
objthe object to auto-stop.

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