MCPcopy Create free account
hub / github.com/apache/impala / AsyncHandler

Method AsyncHandler

be/src/kudu/rpc/reactor.cc:327–344  ·  view source on GitHub ↗

Handle async events. These events are sent to the reactor by other threads that want to bring something to our attention, like the fact that we're shutting down, or the fact that there is a new outbound Transfer ready to send.

Source from the content-addressed store, hash-verified

325// we're shutting down, or the fact that there is a new outbound Transfer
326// ready to send.
327void ReactorThread::AsyncHandler(ev::async& /*watcher*/, int /*revents*/) {
328 DCHECK(IsCurrentThread());
329
330 if (PREDICT_FALSE(reactor_->closing())) {
331 ShutdownInternal();
332 loop_.break_loop(); // break the epoll loop and terminate the thread
333 return;
334 }
335
336 boost::intrusive::list<ReactorTask> tasks;
337 reactor_->DrainTaskQueue(&tasks);
338
339 while (!tasks.empty()) {
340 ReactorTask& task = tasks.front();
341 tasks.pop_front();
342 task.Run(this);
343 }
344}
345
346void ReactorThread::RegisterConnection(scoped_refptr<Connection> conn) {
347 DCHECK(IsCurrentThread());

Callers

nothing calls this directly

Calls 5

DrainTaskQueueMethod · 0.80
frontMethod · 0.80
closingMethod · 0.45
emptyMethod · 0.45
RunMethod · 0.45

Tested by

no test coverage detected