Value members
- Inherited from:
- IOApp.this.runtime.fiberMonitor.liveFiberSnapshot(((_$1:String)=>System.err.print(_$1))))
process.on("SIGUSR2",listener)
process.on("SIGINFO",listener)
}else()
lazyvalkeepAlive:IO[Nothing]=IO.sleep(DurationInt(1).hour).>>[Nothing](keepAlive)
valargList:List[String]=process.argv.getOrElse[List[String]](wrapRefArray[String](args).toList)
valhardExit:Function1[Int,Unit]=Try.apply[Function1[Int,Unit]](js.Dynamic.global.selectDynamic("process").selectDynamic("exit").asInstanceOf[js.Function1[Int,Unit]]).map[Function1[Int,Unit]](((f:Function1[Int,Unit])=>((i:Int)=>{
Try.apply[Unit](f.apply(i))
()
}))).getOrElse[Function1[Int,Unit]](((_$2:Int)=>()))
varcancelCode:Int=1
valfiber:IOFiber[ExitCode]=Spawn.apply[[A>:Nothing<:Any]=>IO[A]](asyncForIO,dummyImplicit).raceOutcome[ExitCode,Nothing](IOApp.this.run(argList),keepAlive).flatMap[ExitCode](((x$1:Either[Outcome[[A>:Nothing<:Any]=>IO[A],Throwable,ExitCode],Outcome[[A>:Nothing<:Any]=>IO[A],Throwable,Nothing]])=>x$1match{
caseLeft(Outcome.Canceled())=>
IO.raiseError[Nothing](newCancellationException("IOAppmainfiberwascanceled"))
caseLeft(Outcome.Errored(t))=>
IO.raiseError[Nothing](t)
caseLeft(Outcome.Succeeded(code))=>
(code:IO[ExitCode])
caseRight(Outcome.Errored(t))=>
IO.raiseError[Nothing](`t₂`)
caseRight(_)=>
sys.error("impossible")
})).unsafeRunFiber(hardExit.apply(cancelCode),((`t₃`:Throwable)=>{
`t₃`.printStackTrace()
hardExit.apply(1)
throw`t₃`
}),((c:ExitCode)=>hardExit.apply(c.code)))(IOApp.this.runtime)
defgracefulExit(`code₂`:Int):Unit={
IOApp.this.runtime.config.shutdownHookTimeoutmatch{
caseDuration.Zero=>
hardExit.apply(`code₂`)
None
casefd:FiniteDuration=>
Some.apply[SetTimeoutHandle](js.timers.setTimeout(fd)(hardExit.apply(`code₂`)))
case_=>
None
}
cancelCode=`code₂`
fiber.cancel.unsafeRunAndForget()(IOApp.this.runtime)
}
Try.apply[Unit](js.Dynamic.global.selectDynamic("process").updateDynamic("exit")(fromFunction1[Int,Unit](((_$3:Int)=>gracefulExit(_$3)))))
process.on("SIGTERM",(()=>gracefulExit(143)))
process.on("SIGINT",(()=>gracefulExit(130)))
}">IOApp
- Source:
- IOApp.scala