You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PR #3757 tries to add the signal handler function Deno.signal(signo). This only handles one kind of signals for each Deno.signal call.
If we add an API which handles multiple kinds of signals at once, what is the interface of that function? Where it belongs?
Option 1: Enhance Deno.signal()
Deno.signal takes multiple signals.
constsig=Deno.signal(Deno.Signal.SIGTERM,Deno.Signal.SIGINT);forawait(_ofsig){console.log("SIGTERM or SIGINT received");}
Option 2: Have a function for it in deno_std
import{signal}from"https://deno.land/std/signal/mod.ts";constsig=signal(Deno.Signal.SIGTERM,Deno.Signal.SIGINT)forawait(_ofsig){console.log("SIGTERM or SIGINT received");}
I feel it is more of a general utility: combine, multiplex and iterate 2 independent async iterators. It does not really need to be functionality built into just signal handlers.
We can implement this as a new util in std
Actually I think MuxAsyncIterator might be used here.
PR #3757 tries to add the signal handler function
Deno.signal(signo)
. This only handles one kind of signals for eachDeno.signal
call.If we add an API which handles multiple kinds of signals at once, what is the interface of that function? Where it belongs?
Option 1: Enhance Deno.signal()
Deno.signal takes multiple signals.
Option 2: Have a function for it in deno_std
Other: Please write in the comment
cc @axetroy
The text was updated successfully, but these errors were encountered: