SuaveIO / suave

Suave is a simple web development F# library providing a lightweight web server and a set of combinators to manipulate route flow and task composition.
https://suave.io
Other
1.32k stars 198 forks source link

Support Task CE natively #761

Open jkone27 opened 2 years ago

jkone27 commented 2 years ago

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 1 year ago

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

ademar commented 1 year ago

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