MCPcopy Create free account
hub / github.com/MultithreadedJSBook/code-samples / randomActor

Function randomActor

ch6-actors/server.js:49–52  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

47});
48// THIS TEXT SHOULD NOT APPEAR IN BOOK
49function randomActor() {
50 const pool = Array.from(actors);
51 return pool[Math.floor(Math.random() * pool.length)];
52}
53
54// PART TWO BEGINS BELOW. THIS TEXT SHOULD NOT APPEAR IN BOOK
55const RpcWorkerPool = require('./rpc-worker.js');

Callers 1

server.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected