Summary: this is going to be a really common pattern, so I'm providing a shortcut
Reviewed By: @fugalh
Differential Revision:
D2146008
globalIOExecutorLock);
}
+EventBase* getEventBase() {
+ return getIOExecutor()->getEventBase();
+}
+
void setIOExecutor(std::shared_ptr<IOExecutor> executor) {
setExecutor(
std::move(executor),
// one or more EventBases.
std::shared_ptr<IOExecutor> getIOExecutor();
+// Retrieve an event base from the global IOExecutor
+EventBase* getEventBase();
+
// Set an IOExecutor to be the global IOExecutor which will be returned by
// subsequent calls to getIOExecutor(). Takes a non-owning (weak) reference.
void setIOExecutor(std::shared_ptr<IOExecutor> executor);