proxygen
RequestWorker.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015-present, Facebook, Inc.
3  * All rights reserved.
4  *
5  * This source code is licensed under the BSD-style license found in the
6  * LICENSE file in the root directory of this source tree. An additional grant
7  * of patent rights can be found in the PATENTS file in the same directory.
8  *
9  */
11 
14 
15 namespace proxygen {
16 
18  FinishCallback& callback, uint8_t threadId, const std::string& evbName)
19  : WorkerThread(folly::EventBaseManager::get(), evbName),
20  nextRequestId_(static_cast<uint64_t>(threadId) << 56),
21  callback_(callback) {
22 }
23 
25  return getRequestWorker()->nextRequestId_++;
26 }
27 
29  CHECK(getEventBase()->isInEventBaseThread());
30  for (auto& p: serviceWorkers_) {
31  p.second->flushStats();
32  }
33 }
34 
38 }
39 
43 }
44 
45 } // proxygen
virtual void cleanup()
—— Concurrent Priority Queue Implementation ——
Definition: AtomicBitSet.h:29
virtual void setup()
virtual void workerStarted(RequestWorker *)=0
RequestWorker(FinishCallback &callback, uint8_t threadId, const std::string &evbName=std::string())
FinishCallback & callback_
Definition: RequestWorker.h:90
static RequestWorker * getRequestWorker()
Definition: RequestWorker.h:47
void cleanup() override
folly::EventBase * getEventBase()
Definition: WorkerThread.h:85
const char * string
Definition: Conv.cpp:212
folly::Function< void()> callback_
static uint64_t nextRequestId()
virtual void workerFinished(RequestWorker *)=0
PUSHMI_INLINE_VAR constexpr detail::get_fn< T > get
Definition: submit.h:391
std::map< Service *, ServiceWorker * > serviceWorkers_
Definition: RequestWorker.h:88