lintel 0.2.0
Loading...
Searching...
No Matches
Public Member Functions | List of all members
lintel::ExecutorService Class Reference

#include <ExecutorService.h>

Public Member Functions

 ExecutorService ()
 
 ~ExecutorService ()
 
template<class F , class... Args>
std::future< typename std::invoke_result< typename std::decay< F >::type, typename std::decay< Args >::type... >::type > execute (F &&f, Args &&...args)
 

Detailed Description

A simple thread pool executor that queues and executes tasks asynchronously.

Constructor & Destructor Documentation

◆ ExecutorService()

lintel::ExecutorService::ExecutorService ( )
inline

Constructor; starts the worker thread.

◆ ~ExecutorService()

lintel::ExecutorService::~ExecutorService ( )
inline

Destructor; signals exit and joins the worker thread.

Member Function Documentation

◆ execute()

template<class F , class... Args>
std::future< typename std::invoke_result< typename std::decay< F >::type, typename std::decay< Args >::type... >::type > lintel::ExecutorService::execute ( F &&  f,
Args &&...  args 
)

Enqueue a callable for asynchronous execution.

Template Parameters
Fcallable type
Argsargument types
Parameters
fcallable to execute
argsarguments to pass to the callable
Returns
a future that will hold the result

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