53 {
54
55 const std::size_t n_of_batches = 2;
56 const std::size_t evts_in_batch = 5;
57
58
60
61
62 MsgStream
log(
app.
as<IMessageSvc>(),
"<main>" );
63
64
67
69
70
71 {
72
73 SmartIF<Gaudi::Interfaces::IQueueingEventProcessor> qep{
app };
74
75
76
77 std::queue<EventContext>
ready;
78
79 std::size_t evt_count = 0;
80
81
82 for ( std::size_t batch = 1; batch <= n_of_batches; ++batch ) {
83
85 if ( batch == 2 ) {
86 log <<
MSG::INFO <<
" (pretend we need time so that the processing thread drains the input queue)"
89 log <<
MSG::INFO <<
" (all events in the queue should have been processed by now)" <<
endmsg;
90 }
91 for ( std::size_t i = 0; i < evts_in_batch; ++i ) {
92
93 auto ctx = qep->createEventContext();
94
95
97 }
98
99
101 while ( !
ready.empty() ) {
102 ++evt_count;
107
108
110 if ( auto result = qep->pop() ) {
111
114 }
115 }
116 }
118 while ( !qep->empty() ) {
119 if ( auto result = qep->pop() ) {
122 } else {
124 }
125 }
126
127
129 }
130
131
134
135
137 }
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
constexpr _OI move(_II __first, _II __last, _OI __result)
void sleep_for(const chrono::duration< _Rep, _Period > &__rtime)
virtual StatusCode finalize()=0
Finalize (from INITIALIZED to CONFIGURED).
virtual StatusCode start()=0
Start (from INITIALIZED to RUNNING).
virtual StatusCode stop()=0
Stop (from RUNNING to INITIALIZED).
virtual StatusCode initialize()=0
Initialization (from CONFIGURED to INITIALIZED).
void ignore() const
Allow discarding a StatusCode without warning.
int getAppReturnCode(const SmartIF< IProperty > &appmgr)
Get the application (current) return code.