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

Function handler

ch6-actors/server.js:15–15  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13// THIS TEXT SHOULD NOT APPEAR IN BOOK
14net.createServer((client) => {
15 const handler = data => client.write(JSON.stringify(data) + '\0'); // <1>
16 actors.add(handler);
17 console.log('actor pool connected', actors.size);
18 client.on('end', () => {

Callers

nothing calls this directly

Calls 1

writeMethod · 0.45

Tested by

no test coverage detected