-
Notifications
You must be signed in to change notification settings - Fork 522
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test FileDescriptorPoller
API for goodness-of-fit with C libraries
#3688
Comments
@armanbilge I implemented a new runtime in However I have some questions/feedbacks regarding the
|
Awesome, thank you so much for giving this an early try, that was a non-trivial implementation. Very helpful feedback; much appreciated!
It's not unfortunately, this is a limitation of the Linux epoll API that forces this API to become the least-common-denominator.
If you anticipate that you will eventually need both reading and writing on an FD then you should register it as read/write from the beginning. There is no harm to register an FD for reading+writing but not using it for reading or writing immediately. On the other hand, every time you register/unregister FDs is expensive (epoll again). So better to do that as little as possible.
I guess this is undefined behavior. On Linux it will currently raise an error (epoll :), but this will become non-deterministic when we have a multi-threaded runtime. For kqueue and io_uring it would probably be fine ... I'll update the doc to say it's undefined.
Yes, the I hope that answers your questions! |
I confirm that the new API works correctly with SNUnit. The library was updated to use the new API, all tests pass and it is released. |
I just released
3.6-e9aeb8c
, a milestone of Cats Effect v3.6.0 which introduces file descriptor I/O polling built-in to the runtime. The goal is to foster an ecosystem of wrappers for C libraries that can be used simultaneously in the same application, alongside Typelevel-native libraries such as Ember and Skunk.Before releasing, we should test the proposed API for goodness-of-fit.
cats-effect/core/native/src/main/scala/cats/effect/FileDescriptorPoller.scala
Line 19 in e9aeb8c
Two integrations that I am interested in are:
SNUnit, cc @lolgab
I hope the integration should be fairly straightforward. A background fiber should be started with something like this:
http4s-curl, cc @hnaderi
This one will take a bit more work but is also conceptually straightforward: there are a couple fibers per socket that wait for readiness and then invoke the appropriate cURL library methods. I have written up a dedicated issue.
Implement a
CurlClient
based onFileDescriptorPoller
http4s/http4s-curl#117The text was updated successfully, but these errors were encountered: