Skip to main content
Worker.prototype.ref - worker_threads - Node documentation
method Worker.prototype.ref

Usage in Deno

import { Worker } from "node:worker_threads";
Worker.prototype.ref(): void

Opposite of unref(), calling ref() on a previously unref()ed worker does not let the program exit if it's the only active handle left (the default behavior). If the worker is ref()ed, calling ref() again has no effect.

Return Type

void