Go to the source code of this file.
◆ main()
Definition at line 42 of file main.cpp.
46 {
"ApplicationMgr.JobOptionsType",
"\"NONE\"" },
47 {
"ApplicationMgr.EventLoop",
"\"Gaudi::TestSuite::QueueingEventLoopMgr/QueueingEventLoopMgr\"" },
48 {
"ApplicationMgr.OutputLevel",
"3" },
49 {
"ApplicationMgr.TopAlg",
"['GaudiTesting::SleepyAlg/Alg1']" },
50 {
"Alg1.SleepTime",
"1" },
51 {
"QueueingEventLoopMgr.OutputLevel",
"2" },
52 {
"QueueingEventLoopMgr.Capacity",
"3" } };
58 const std::size_t n_of_batches = 2;
59 const std::size_t evts_in_batch = 5;
62 app->initialize().ignore();
71 app->start().ignore();
80 std::queue<EventContext> ready;
82 std::size_t evt_count = 0;
85 for ( std::size_t batch = 1; batch <= n_of_batches; ++batch ) {
89 log <<
MSG::INFO <<
" (pretend we need time so that the processing thread drains the input queue)"
92 log <<
MSG::INFO <<
" (all events in the queue should have been processed by now)" <<
endmsg;
94 for ( std::size_t i = 0; i < evts_in_batch; ++i ) {
96 auto ctx = qep->createEventContext();
99 ready.push( std::move(
ctx ) );
104 while ( !ready.empty() ) {
106 log <<
MSG::INFO <<
"- pushing event " << evt_count <<
" (" << ready.front() <<
")..." <<
endmsg;
107 qep->push( std::move( ready.front() ) );
113 if (
auto result = qep->pop() ) {
115 auto&& [sc,
ctx] = std::move( *result );
121 while ( !qep->empty() ) {
122 if (
auto result = qep->pop() ) {
123 auto&& [sc,
ctx] = std::move( *result );
135 app->stop().ignore();
136 app->finalize().ignore();