20 #include <ripple/beast/unit_test.h>
21 #include <ripple/core/JobQueue.h>
22 #include <test/jtx/Env.h>
36 JobQueue& jQueue = env.app().getJobQueue();
46 while (jobRan ==
false)
53 using namespace std::chrono_literals;
56 jCounter.
join(
"JobQueue_test", 1s, j);
74 JobQueue& jQueue = env.app().getJobQueue();
82 while (++yieldCount < 4)
85 BEAST_EXPECT(coro !=
nullptr);
88 while (yieldCount == 0)
93 while (coro->runnable())
95 BEAST_EXPECT(coro->post());
96 while (old == yieldCount)
100 BEAST_EXPECT(++old == yieldCount);
102 BEAST_EXPECT(yieldCount == 4);
111 while (++yieldCount < 4)
126 int old = yieldCount;
127 while (coro->runnable())
130 BEAST_EXPECT(++old == yieldCount);
132 BEAST_EXPECT(yieldCount == 4);
138 using namespace std::chrono_literals;
141 jCounter.
join(
"JobQueue_test", 1s, j);
153 BEAST_EXPECT(coro ==
nullptr);
BEAST_DEFINE_TESTSUITE(AccountDelete, app, ripple)
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.
JobCounter & jobCounter()
A generic endpoint for log messages.
A pool of threads to perform work.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
void join(char const *name, std::chrono::milliseconds wait, beast::Journal j)
Returns once all counted in-flight closures are destroyed.
A transaction testing environment.