Skip to main content

unref

method MessagePort.prototype.unref
Jump to headingMessagePort.prototype.unref(): void

Calling unref() on a port allows the thread to exit if this is the only active handle in the event system. If the port is already unref()ed calling unref() again has no effect.

If listeners are attached or removed using .on('message'), the port is ref()ed and unref()ed automatically depending on whether listeners for the event exist.

Return Type Jump to heading

void
Back to top