#include <Threadpool.h>
|
| Threadpool (const unsigned int size=4) |
|
| Threadpool (const Threadpool &)=delete |
|
| ~Threadpool () |
|
template<typename F , typename R = std::invoke_result_t<std::decay_t<F>>, typename = std::enable_if_t<!std::is_void_v<R>>> |
SharedFuture< R > | execute (F &&task) |
|
template<typename F , typename = std::enable_if_t<std::is_void_v<std::invoke_result_t<std::decay_t<F>>>>> |
SharedFuture< void > | execute (F &&task) |
|
◆ Threadpool() [1/2]
DiscordCPP::Threadpool::Threadpool |
( |
const unsigned int | size = 4 | ) |
|
|
explicit |
Creates a new Threadpool.
- Parameters
-
[in] | size | (optional) The number of threads the threadpool should contain. Defaults to 4. |
◆ Threadpool() [2/2]
DiscordCPP::Threadpool::Threadpool |
( |
const Threadpool & | | ) |
|
|
delete |
◆ ~Threadpool()
DiscordCPP::Threadpool::~Threadpool |
( |
| ) |
|
◆ execute() [1/2]
template<typename F , typename R = std::invoke_result_t<std::decay_t<F>>, typename = std::enable_if_t<!std::is_void_v<R>>>
SharedFuture< R > DiscordCPP::Threadpool::execute |
( |
F && | task | ) |
|
|
inline |
Executes a function on the Threadpool.
- Parameters
-
[in] | task | function to be executed. |
- Returns
- shared future that will contain the result produced by task.
◆ execute() [2/2]
template<typename F , typename = std::enable_if_t<std::is_void_v<std::invoke_result_t<std::decay_t<F>>>>>
SharedFuture< void > DiscordCPP::Threadpool::execute |
( |
F && | task | ) |
|
|
inline |
Executes a function on the Threadpool.
- Parameters
-
[in] | task | function to be executed. |
- Returns
- shared future that will contain the result produced by task.
The documentation for this class was generated from the following files: