This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const { Worker, isMainThread, parentPort, threadId } = require('worker_threads'); | |
| const os = require('os'); | |
| const http = require('http'); | |
| const fs = require('fs'); | |
| if (isMainThread) { | |
| const workers = []; | |
| const workerCount = os.cpus().length; | |
| for (let i = 0; i < workerCount; ++i) { | |
| workers.push(new Worker(__filename, {})); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from enum import Enum | |
| from functools import reduce | |
| from collections import Iterable | |
| def auto_str(cls): | |
| def build_key_value_str(key, value, intent): | |
| return build_intent(intent) + key + ': ' + value + '\n' | |
| def is_enum(obj): |