aboutsummaryrefslogtreecommitdiff
path: root/works/life/computer-network-experiment/Output.cpp
blob: 41e14e610ce1b86bc371c5502610a6f8387da2e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include "Output.h"

folly::MPMCQueue<Output> output_queue;

void OutputThread() {
  while (true) {
    Output output;
    output_queue.blockingRead(output);
    switch (output.type) {
    case OutputType::Error:
      std::wcerr << output.message;
      break;
    default:
      std::wcout << output.message;
      break;
    }
  }
}