YACLib
C++ library for concurrent tasks execution
Loading...
Searching...
No Matches
submit.hpp
Go to the documentation of this file.
1#pragma once
2
5
6#include <utility>
7
8namespace yaclib {
9
10/**
11 * Submit given func for details \see Submit
12 *
13 * This method creates Job with one allocation and call Submit(Job)
14 * \param f func to execute
15 */
16template <typename Func>
18 static_assert(!std::is_base_of_v<Job, std::decay_t<Func>>, "Please use executor.Submit(job)");
19 auto* job = detail::MakeUniqueJob(std::forward<Func>(f));
20 executor.Submit(*job);
21}
22
23} // namespace yaclib
Job * MakeUniqueJob(Func &&f)
void Submit(IExecutor &executor, Func &&f)
Submit given func for details.
Definition submit.hpp:17
Contract< V, E > MakeContract()
Creates related future and promise.
Definition contract.hpp:25