LeviLamina
Loading...
Searching...
No Matches
ThreadPoolExecutor.h
1#pragma once
2
3#include "ll/api/coro/Executor.h"
4
5namespace ll::thread {
6class ThreadPoolExecutor final : public coro::Executor {
7 struct Impl;
8 std::unique_ptr<Impl> impl;
9
10public:
11 LLAPI explicit ThreadPoolExecutor(std::string name, size_t nThreads = 1);
12
13 LLAPI ~ThreadPoolExecutor() override;
14
15 LLAPI void resize(size_t nThreads = 1);
16 LLAPI void destroy();
17
18 LLAPI void execute(std::function<void()>) const override;
19
20 LLAPI std::shared_ptr<data::CancellableCallback> executeAfter(std::function<void()>, Duration) const override;
21
22 LLNDAPI static ThreadPoolExecutor const& getDefault();
23};
24} // namespace ll::thread
Definition Executor.h:17
Definition ThreadPoolExecutor.h:6