async_queue.cpp 460 B

123456789101112131415161718
  1. #include "async_queue.h"
  2. namespace NYql {
  3. TAsyncQueue::TAsyncQueue(size_t numThreads, const TString& poolName) {
  4. if (1 == numThreads) {
  5. MtpQueue_.Reset(new TFakeThreadPool());
  6. } else {
  7. MtpQueue_.Reset(new TSimpleThreadPool(TThreadPoolParams{poolName}));
  8. }
  9. MtpQueue_->Start(numThreads);
  10. }
  11. TAsyncQueue::TPtr TAsyncQueue::Make(size_t numThreads, const TString& poolName) {
  12. return new TAsyncQueue(numThreads, poolName);
  13. }
  14. }