Skip to content

Module doesn't self-register from a worker thread #831

@yura415

Description

@yura415

Environment Information

  • OS [e.g. Mac, Arch, Windows 10]: Alpine (docker)
  • Node Version [e.g. 8.2.1]: node:12-alpine
  • NPM Version [e.g. 5.4.2]: v5
  • C++ Toolchain [e.g. Visual Studio, llvm, g++]:
  • node-rdkafka version [e.g. 2.3.3]: 2.8.1

Steps to Reproduce

const {
  Worker, isMainThread
} = require('worker_threads');
const kafka = require('node-rdkafka');

if (isMainThread) {
   // Brand new worker
   new Worker(__filename);
}

Additional context

Even though this issue relates to nodejs internal implementation of workers, nodejs developers wont fix it. However it can be fixed by making native module context-aware. Here is an example for node-lzo: schroffl/node-lzo#11

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions