Skip to content

Add support for JRuby using NIO.2 WatchService #462

Open

Description

@headius

I believe listen on JRuby will fall back on a polling implementation currently, since most of the adapters require C extensions. Specifically, I was looking at the Windows adapter, which needs the "wdm" extension on CRuby.

However, JRuby runs on the JDK, which has a built-in, cross-platform filesystem eventing API:

https://docs.oracle.com/javase/tutorial/essential/io/notification.html

Judging by the other adapters, it seems like we wouldn't need to write much code to support efficient filesystem monitoring for JRuby on all platforms where the JDK exists (which is pretty much all platforms).

Opening this issue in case someone with more time than me wants to give it a shot.

Activity

  1. bratish commented on Aug 3, 2019

    @bratish

    I am willing to work on this. Might require some assistance though. Please let me know.

  2. headius commented on Aug 3, 2019

    @headius
    Author

    @bratish Sure, have a look at the tutorial and there are some examples of importing a Java API in our samples directory. Once you have imported something, it's mostly just plain Ruby.

  3. bratish commented on Aug 3, 2019

    @bratish

    Thanks, @headius. @floehopper has submitted a patch already.

  4. donv commented on Aug 11, 2021

    @donv

    Any progress on this one?

  5. headius commented on Jan 13, 2022

    @headius
    Author

    @donv I guess @floehopper PR was closed but hopefully we can still make this happen. Might need someone else to jump in on it.

  6. floehopper commented on Jan 13, 2022

    @floehopper
    Contributor

    I'm afraid I'm unlikely to have time to work on the PR in the near future. I hope someone else can help.

  7. headius commented on Jan 13, 2022

    @headius
    Author

    @floehopper No worries, hopefully what you have will be a good start for someone. I tweeted out a call for help!

    https://twitter.com/headius/status/1481693790645673984

  8. ColinDKelley commented on Nov 29, 2022

    @ColinDKelley
    Collaborator

    @headius Any updates here? I agree that it looks very possible. @bratish Would you possibly be interested still?

  9. ColinDKelley commented on Feb 28, 2024

    @ColinDKelley
    Collaborator

    @headius @bratish Any updates here?

  10. headius commented on Feb 28, 2024

    @headius
    Author

    No updates on my end. It appears that MacOS still does not have a good way to implement this on JVM, so any NIO-based version should probably just be used on Linux and Windows which both have good file notification APIs. I don't have time to work on this currently though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions