SuaveIO/suave

Support Task CE natively

jkone27 opened this issue · 2 comments

maybe also providing support for Task or IcedTask instead of Async could improve suave performance quite a bit over the original async.

since latest F# we have native task CE support, and now also this was recently published/developed..

https://github.com/TheAngryByrd/IcedTasks

njlr commented

I could imagine a type like this working well:

[<Struct>]
type Response<'t> =
  | Value of value : 't
  | Sync of sync : (unit -> 't)
  | Async of async : Async<'t>
  | ColdTask of coldTask : (unit -> Task<'t>)
  | CancellableTask of cancellableTask : (CancellationToken -> Task<'t>)

It would be a breaking change though

Agreed I think is about time to bring Task to Suave.