I have a embebed server for a mobile device that could crash sometimes. I need to always have the server alive. Now the problem is that I don't see how restart the server when it is async:
let startServer(rootPath) =
let cf = serverConfig rootPath
printfn "%A" cf
startWebServerAsync cf app
|> snd
|> Async.StartAsTask
type App() =
inherit Application()
let mutable task:System.Threading.Tasks.Task = null
do
let t = startServer(...)
task <- t //The task is hold here to avoid it being GC..
How clean all and restart the server?