MessagePort.prototype.unref - Node documentation
method MessagePort.prototype.unref

Usage in Deno

import { MessagePort } from "node:worker_threads";
MessagePort.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 callingunref() again has no effect.

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

Return Type

void