Skip to content

Commit

Permalink
Fix main()s to call folly::init/initFacebook/registrationComplete (pa…
Browse files Browse the repository at this point in the history
…rt 15)

Summary:
Required for D4821763
Based on targets from https://fb.facebook.com/groups/fbcode/permalink/1304073246296178/ (I also excluded those targets which do not depend on folly:singleton).

Reviewed By: yfeldblum

Differential Revision: D4841926

fbshipit-source-id: 0615287f51e18d4c1374b620495ca6316c7ebeed
  • Loading branch information
andriigrynenko authored and facebook-github-bot committed Apr 6, 2017
1 parent 13d9266 commit c8d49be
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion wangle/example/telnet/TelnetClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
#include <iostream>
#include <gflags/gflags.h>

#include <folly/init/Init.h>

#include <wangle/bootstrap/ClientBootstrap.h>
#include <wangle/channel/AsyncSocketHandler.h>
#include <wangle/channel/EventBaseHandler.h>
Expand Down Expand Up @@ -56,7 +58,7 @@ class TelnetPipelineFactory : public PipelineFactory<TelnetPipeline> {
};

int main(int argc, char** argv) {
gflags::ParseCommandLineFlags(&argc, &argv, true);
folly::init(&argc, &argv, true);

ClientBootstrap<TelnetPipeline> client;
client.group(std::make_shared<wangle::IOThreadPoolExecutor>(1));
Expand Down
4 changes: 3 additions & 1 deletion wangle/example/telnet/TelnetServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

#include <gflags/gflags.h>

#include <folly/init/Init.h>

#include <wangle/bootstrap/ServerBootstrap.h>
#include <wangle/channel/AsyncSocketHandler.h>
#include <wangle/codec/LineBasedFrameDecoder.h>
Expand Down Expand Up @@ -60,7 +62,7 @@ class TelnetPipelineFactory : public PipelineFactory<TelnetPipeline> {
};

int main(int argc, char** argv) {
gflags::ParseCommandLineFlags(&argc, &argv, true);
folly::init(&argc, &argv, true);

ServerBootstrap<TelnetPipeline> server;
server.childPipeline(std::make_shared<TelnetPipelineFactory>());
Expand Down

0 comments on commit c8d49be

Please sign in to comment.