Evo C++ Library v0.5.1
Classes | Public Types | Public Member Functions | List of all members
AsyncEventLoop Class Reference

#include <evo/ioasync_base.h>

Detailed Description

Manages an event-loop for async I/O.

Public Types

typedef struct event_base * Handle
 

Public Member Functions

 AsyncEventLoop ()
 Constructor. More...
 
 ~AsyncEventLoop ()
 Destructor. More...
 
bool active () const
 Get whether event-loop is active. More...
 
Handle handle ()
 Get event loop handle. More...
 
bool run1 ()
 Run event loop with one pass and process I/O events. More...
 
void shutdown ()
 Shutdown event loop. More...
 

Member Typedef Documentation

◆ Handle

typedef struct event_base* Handle

Constructor & Destructor Documentation

◆ AsyncEventLoop()

AsyncEventLoop ( )
inline

Constructor.

◆ ~AsyncEventLoop()

~AsyncEventLoop ( )
inline

Destructor.

Member Function Documentation

◆ active()

bool active ( ) const
inline

Get whether event-loop is active.

Returns
Whether active

◆ handle()

Handle handle ( )
inline

Get event loop handle.

Returns
Handle

◆ run1()

bool run1 ( )
inline

Run event loop with one pass and process I/O events.

  • This waits until some events are active then processes all active events and returns
  • Use notify1() to wake this up if it's blocking/waiting so the caller can do other processing
  • Caution: run*() methods must only be called from 1 thread at a time, otherwise results are undefined
Returns
Whether successful, false on internal error

◆ shutdown()

void shutdown ( )
inline

Shutdown event loop.


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