MCPcopy Create free account
hub / github.com/Abc-Arbitrage/Disruptor-cpp / scheduleAndStart

Method scheduleAndStart

Disruptor/ThreadPerTaskScheduler.cpp:31–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29 }
30
31 std::future<void> ThreadPerTaskScheduler::scheduleAndStart(std::packaged_task<void()>&& task)
32 {
33 auto result = task.get_future();
34
35 m_threads.emplace_back([this, task{ move(task) }] () mutable
36 {
37 while(m_started)
38 {
39 try
40 {
41 task();
42 }
43 catch (...)
44 {
45 }
46 }
47 });
48
49 return result;
50 }
51
52} // namespace Disruptor

Callers 3

executeMethod · 0.45
runMethod · 0.45
runMethod · 0.45

Calls

no outgoing calls

Tested by 2

runMethod · 0.36
runMethod · 0.36