Skip to content

Commit d17cd13

Browse files
committed
Enable socket to be closed
1 parent d74bf1d commit d17cd13

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/DenoWorker.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,16 @@ export class DenoWorker {
419419
return this._postMessage(null, data, transfer);
420420
}
421421

422+
/**
423+
* Closes the websocket, which may allow the process to exit natually.
424+
*/
425+
closeSocket() {
426+
if (this._socket) {
427+
this._socket.close();
428+
this._socket = null;
429+
}
430+
}
431+
422432
/**
423433
* Terminates the worker and cleans up unused resources.
424434
*/

0 commit comments

Comments
 (0)