This file contains 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 linearArray = []; | |
const testArray = { | |
// The array that will hold the values | |
array: [], | |
// The inverted index | |
index: {}, | |
// The push function | |
push: function (value) { | |
// Push the value to the array |
This file contains 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 cluster = require('cluster'); | |
const http = require('http'); | |
if (cluster.isMaster) { | |
for (let i = 0; i < 10; i++) { | |
cluster.fork(); | |
} | |
let workers = Object.values(cluster.workers) | |
cluster.on('exit', (worker, code, signal) => { |
This file contains 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 { cacheCandidate } = require("@jointly/cache-candidate"); | |
const myFn = () => { | |
return new Promise((resolve, reject) => { | |
setTimeout(() => { | |
resolve('Hello World'); | |
}, 1000); | |
}); | |
} |