hieumc
hieumc

Reputation: 1

NODEJS - Call function between worker_threads and parent (or vice versa)

result = await messenger.callParent('testParentFunc', 'args', timeout)
result = await messenger.callWorker('testFunction', 'args', timeout)

It works by postingMessage and waiting for the response. Hope it is useful to you.

Upvotes: 0

Views: 77

Answers (0)

Related Questions