educative.io

How worker has send method from invoke acquire function

from this pic at line 20 (worker.send({ sum: this.sum, set: this.set }))

i wonder how “worker” that return from invoke function acquire have send method (which explain that it shuold be come form “fork”) but in processPool class it didn’t return any worker variable out of function
it only return promise as following picture

so how worker can inherit “send” method from “acquire” ?


Course: Node.js Design Patterns - Learn Interactively
Lesson: Using External Processes (II) - Node.js Design Patterns