<commit_before>// Copyright (c) 2017 The Absolute Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import cluster from 'cluster';
import os from 'os';

// Policy of dispatching task to another worker available
// cluster.SCHED_NONE to leave it to the operating system
// cluster.SCHED_RR for round-robin
cluster.schedulingPolicy = cluster.SCHED_RR;

if (cluster.isMaster) {
  // master worker
  os.cpu.forEach((cpu) => {
    cluster.fork();
  });
  // recieve message from worker
  cluster.on('exit', (worker, code, siganl) => {
      if (code == 200) {
          // cluster.fork();
      }
  });
} else if (cluster.isWoker) {
  // child worker
  // i.e) server.js
  // import server from server;
  console.log(`worker id: ${cluster.worker.id}`);
}<commit_msg>Fix a typo in worker_manager.js (#265)<commit_after>// Copyright (c) 2017 The Absolute Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import cluster from 'cluster';
import os from 'os';

// Policy of dispatching task to another worker available
// cluster.SCHED_NONE to leave it to the operating system
// cluster.SCHED_RR for round-robin
cluster.schedulingPolicy = cluster.SCHED_RR;

if (cluster.isMaster) {
  // master worker
  os.cpus().forEach((cpu) => {
    cluster.fork();
  });
  // recieve message from worker
  cluster.on('exit', (worker, code, siganl) => {
      if (code == 200) {
          // cluster.fork();
      }
  });
} else if (cluster.isWoker) {
  // child worker
  // i.e) server.js
  // import server from server;
  console.log(`worker id: ${cluster.worker.id}`);
}
{'fraction_non_alphanumeric': 0.13372093023255813, 'fraction_numerical': 0.009883720930232558, 'mean_word_length': 3.0685579196217496, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4117372', 'n_tokens_mistral': 551, 'n_tokens_neox': 525, 'n_words': 185}