Thanks for feedback. > Make what asyncCheck does overridable, so that we don't need to change all > our asyncCheck calls.
Yes, that sounds like good option, possible implementation, note the new `checkRequest` parameter: proc serve*(server: AsyncHttpServer, port: Port, callback: proc (request: Request): Future[void] {.closure, gcsafe.}, address = ""; assumedDescriptorsPerRequest = -1, checkRequest: proc (future: Future[void]): void = asyncCheck) {.async.} = listen server, port, address while true: if shouldAcceptRequest(server, assumedDescriptorsPerRequest): var (address, client) = await server.socket.acceptAddr() checkRequest processClient(server, client, address, callback) else: poll() Run > For my own programs I have created an asyncLog proc which does exactly what > asyncCheck does, except it logs errors to terminal. I did similar thing `proc spawn_async*[T](future: Future[T], check = true)` it's copy of the `asyncCheck` with the `check` parameter that controls if error will be raised or the future result be ignored. I called it `spawn` because conceptually we are starting a separate control flow, a separately running program, async/future is just an implementation detail. > Eliminate the need for asyncCheck. I think what `asyncCheck` does is a reasonable thing. We spawn separate program (as async) and we want to know how it's doing. We may extend it to do more, like sometimes we want to crash the whole program if one of its spawned children fails, sometimes we want to ignore it, sometimes we want to ignore and log it, sometimes spawn another if it fails. I think those use cases are too specific and should be handled by developers by providing its own `checkAndDoWhatIWant` function.