set internal thread factory
authorDave Watson <davejwatson@fb.com>
Mon, 24 Nov 2014 20:36:30 +0000 (12:36 -0800)
committerDave Watson <davejwatson@fb.com>
Thu, 11 Dec 2014 16:01:19 +0000 (08:01 -0800)
Summary: Fix up a TODO

Test Plan: ??  Should I bother with a test?

Reviewed By: jsedgwick@fb.com

Subscribers: doug, fugalh, njormrod, folly-diffs@

FB internal diff: D1710633

Signature: t1:1710633:1417469890:9e8513140bae79da384c9d5418d4ea0840efbe6c

folly/experimental/wangle/bootstrap/ServerBootstrap.h

index 8f29cb525ea7d6aa1488b8a6196ad0f821fa0ed8..4d55c4e36b5f6ed6a216399fa5fc1b9ff7d9dab0 100644 (file)
@@ -102,9 +102,11 @@ class ServerBootstrap {
       io_group = std::make_shared<folly::wangle::IOThreadPoolExecutor>(
         32, std::make_shared<wangle::NamedThreadFactory>("IO Thread"));
     }
-    auto factory = io_group->getThreadFactory();
-
-    //CHECK(factory == nullptr); // TODO
+    auto factoryBase = io_group->getThreadFactory();
+    CHECK(factoryBase);
+    auto factory = std::dynamic_pointer_cast<folly::wangle::NamedThreadFactory>(
+      factoryBase);
+    CHECK(factory); // Must be named thread factory
 
     CHECK(acceptorFactory_ || pipelineFactory_);
 
@@ -115,6 +117,7 @@ class ServerBootstrap {
       workerFactory_ = std::make_shared<ServerWorkerFactory>(
         std::make_shared<ServerAcceptorFactory<Pipeline>>(pipelineFactory_));
     }
+    workerFactory_->setInternalFactory(factory);
 
     acceptor_group_ = accept_group;
     io_group_ = io_group;