3

I know Suave.io is non-blocking but is it using single thread like Node.js? Is it similar to Kestrel as explained here - Is Kestrel using a single thread for processing requests like Node.js??

As a context, I am trying to build a data loader for GraphQL using Suave and FSharp.Data.GraphQL. To perform batching and auto-dispatching, I need to build a clock based batch queue.

Harshal Patil
  • 17,838
  • 14
  • 60
  • 126
  • Did you get any success with this? Currently investigating FSharp.Data.GraphQL for my GraphQL backend but no word(documentation or example) on a dataLoader support is really pushing me away from it – MRainzo Feb 03 '21 at 19:11
  • 1
    @MRainzo Nope, I did not. Coming from Node.js background, I though I could build a similar Data Loader but Async in .NET is way different. In fact, `async` resolution with threading is not predictable. Either, you need instrumentation like what [HotChocolate](https://chillicream.com/platform) has done or rely on timer based batching. I have added the sample implementation here [Gitter F# GraphQL channel](https://gitter.im/FSharp-Data-GraphQL/community). – Harshal Patil Feb 04 '21 at 05:00
  • 1
    @MRainzo Alternately, you can consider using HotChocolate. It is not as good and as functional as `FSharp.Data.GraphQL` but it gets the job done. Mostly you end up writing classes and objects. F# is awesome languages but ecosystem is very problematic. I have switched to Elixir for back-end development. It provides everything that a modern Web Application would need. – Harshal Patil Feb 04 '21 at 05:05
  • I am also considering switching from F# but I really love the language. I will investigate Elixir as I've heard some good things about it – MRainzo Feb 04 '21 at 10:52
  • There is a question about data-loaders in FSharp.Data.GraphQL here: https://stackoverflow.com/questions/63685864/how-can-i-implement-batching-in-fsharp-data-graphql?rq=1 – sdgfsdh Jun 23 '22 at 08:51
  • You can use Giraffe (and other ASP.NET based libraries) with FSharp.Data.GraphQL. These are multi-threaded. – sdgfsdh Jun 23 '22 at 08:52

0 Answers0