1#include <test/jtx/Env.h>
3#include <xrpld/core/JobQueue.h>
5#include <xrpl/beast/unit_test.h>
19 JobQueue& jQueue = env.app().getJobQueue();
28 while (jobRan ==
false)
35 using namespace std::chrono_literals;
54 JobQueue& jQueue = env.app().getJobQueue();
62 while (++yieldCount < 4)
65 BEAST_EXPECT(coro !=
nullptr);
68 while (yieldCount == 0)
73 while (coro->runnable())
75 BEAST_EXPECT(coro->post());
76 while (old == yieldCount)
80 BEAST_EXPECT(++old == yieldCount);
82 BEAST_EXPECT(yieldCount == 4);
91 while (++yieldCount < 4)
106 int old = yieldCount;
107 while (coro->runnable())
110 BEAST_EXPECT(++old == yieldCount);
112 BEAST_EXPECT(yieldCount == 4);
118 using namespace std::chrono_literals;
131 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.