1#include <test/jtx/Env.h>
3#include <xrpl/beast/unit_test.h>
4#include <xrpl/core/JobQueue.h>
18 JobQueue& jQueue = env.app().getJobQueue();
27 while (jobRan ==
false)
34 using namespace std::chrono_literals;
53 JobQueue& jQueue = env.app().getJobQueue();
61 while (++yieldCount < 4)
64 BEAST_EXPECT(coro !=
nullptr);
67 while (yieldCount == 0)
72 while (coro->runnable())
74 BEAST_EXPECT(coro->post());
75 while (old == yieldCount)
79 BEAST_EXPECT(++old == yieldCount);
81 BEAST_EXPECT(yieldCount == 4);
90 while (++yieldCount < 4)
105 int old = yieldCount;
106 while (coro->runnable())
109 BEAST_EXPECT(++old == yieldCount);
111 BEAST_EXPECT(yieldCount == 4);
117 using namespace std::chrono_literals;
130 BEAST_EXPECT(coro ==
nullptr);
A pool of threads to perform work.
std::shared_ptr< Coro > postCoro(JobType t, std::string const &name, F &&f)
Creates a coroutine and adds a job to the queue which will run it.
bool addJob(JobType type, std::string const &name, JobHandler &&jobHandler)
Adds a job to the JobQueue.
void run() override
Runs the suite.
A transaction testing environment.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.