I hereby claim:
- I am alexpsi on github.
- I am alexpsi (https://keybase.io/alexpsi) on keybase.
- I have a public key whose fingerprint is A848 8F9A 1E2B 21B8 8A3A 0BBF 306D 71A6 4ACD 37EA
To claim this, I am signing this object:
const chunks = (arr, chunkSize) => { | |
let results = []; | |
while (arr.length) results.push(arr.splice(0, chunkSize)); | |
return results; | |
}; | |
module.exports = (xs, f, concurrency) => { | |
if (xs.length == 0) return Promise.resolve(); | |
return Promise.all(chunks(xs, concurrency).reduce( | |
(acc, chunk) => acc.then(() => Promise.all(chunk.map(f))), |
I hereby claim:
To claim this, I am signing this object:
// sending to sender-client only | |
socket.emit('message', "this is a test"); | |
// sending to all clients, include sender | |
io.emit('message', "this is a test"); | |
// sending to all clients except sender | |
socket.broadcast.emit('message', "this is a test"); | |
// sending to all clients in 'game' room(channel) except sender |