Skip to content
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

Allow registering a custom Predicate for determining non-blocking threads #3847

Closed

Commits on Jul 15, 2024

  1. Allow registering a custom Predicate for determining non-blocking t…

    …hreads
    
    Related issue: reactor#3833
    Motivation:
    
    It is currently not possible to create a non-blocking threads without
    implementing the `reactor.core.scheduler.NonBlocking` interface. Some
    third-party libraries and frameworks don't directly depend on
    `reactor-core`, yet they want to mark the threads they manage as
    non-blocking.
    
    Modifications:
    
    - Added a new method `Schedulers.registerNonBlockingThreadPredicate()`
      so that a user can register their own `Predicate` that determines
      whether a given thread is non-blocking or not
    - Fixed an incorrectly implemented test that doesn't really test
      anything:
      - `SchedulersTest.isInNonBlockingThreadTrue()`
    
    Result:
    
    - Closes reactor#3833
    - A user can now mark their own `Thread` classes as non-blocking without
      depending on `reactor-core` or implementing the `NonBlocking` marker
      interface.
    trustin committed Jul 15, 2024
    Configuration menu
    Copy the full SHA
    91fba0f View commit details
    Browse the repository at this point in the history

Commits on Jul 22, 2024

  1. Address the review comments

    - Added `Schedulers.resetNonBlockingThreadPredicate()`
    - Updated `SchedulersTest` to use and test `resetNonBlockingThreadPredicate()`
    trustin committed Jul 22, 2024
    Configuration menu
    Copy the full SHA
    f6b4991 View commit details
    Browse the repository at this point in the history