summaryrefslogtreecommitdiffstats
path: root/yql/essentials/utils/threading/async_queue.cpp
blob: c910c68ef60500d1254d1a8991aac6e8526bbbd0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include "async_queue.h"

namespace NYql {

TAsyncQueue::TAsyncQueue(size_t numThreads, const TString& poolName) {
    if (1 == numThreads) {
        MtpQueue_.Reset(new TFakeThreadPool());
    } else {
        MtpQueue_.Reset(new TSimpleThreadPool(TThreadPoolParams{poolName}));
    }
    MtpQueue_->Start(numThreads);
}

TAsyncQueue::TPtr TAsyncQueue::Make(size_t numThreads, const TString& poolName) {
    return new TAsyncQueue(numThreads, poolName);
}

} // namespace NYql