Skip to content

Conversation

@nateberkopec
Copy link
Member

No description provided.

@dentarg
Copy link
Member

dentarg commented May 12, 2023

What's the motivation behind this change?

Looks good to me, the only thing I don't understand is the #delete call

@nateberkopec
Copy link
Member Author

I really don't like the ternary statement 😆 sitting at RubyKaigi and reading reactor.rb with some spare time...

@nateberkopec
Copy link
Member Author

@dentarg Hopefully this clarifies:
Screenshot 2023-05-12 at 4 40 26 PM

@nateberkopec nateberkopec merged commit 2f32c1d into master May 12, 2023
@nateberkopec nateberkopec deleted the reactor-nio-change branch May 12, 2023 07:41
ning-github added a commit to ning-github/puma that referenced this pull request Nov 2, 2024
puma#3151 broke JRuby selector
initialization via the following:

```
NIO::Selector.backends.delete(backend) => nil
```

What results is that `::NIO::Selector.new(nil)` is not the same as
`::NIO::Selector.new`.

The former invokes
https://github.com/socketry/nio4r/blob/v2.5.2/ext/nio4r/org/nio4r/Selector.java#L47,
which results in an exception being thrown.

This PR will restore the reactor initialization to call the intended
https://github.com/socketry/nio4r/blob/v2.5.2/ext/nio4r/org/nio4r/Selector.java#L41
ning-github added a commit to ning-github/puma that referenced this pull request Nov 2, 2024
puma#3151 broke JRuby selector
initialization via the following:

```
NIO::Selector.backends.delete(backend) => nil
```

What results is that `::NIO::Selector.new(nil)` is not the same as
`::NIO::Selector.new`.

The former invokes
https://github.com/socketry/nio4r/blob/v2.5.2/ext/nio4r/org/nio4r/Selector.java#L47,
which results in an exception being thrown.

This PR will restore the reactor initialization to call the intended
https://github.com/socketry/nio4r/blob/v2.5.2/ext/nio4r/org/nio4r/Selector.java#L41
ning-github added a commit to ning-github/puma that referenced this pull request Jan 29, 2025
puma#3151 broke JRuby selector
initialization via the following:

```
NIO::Selector.backends.delete(backend) => nil
```

What results is that `::NIO::Selector.new(nil)` is not the same as
`::NIO::Selector.new`.

The former invokes
https://github.com/socketry/nio4r/blob/v2.5.2/ext/nio4r/org/nio4r/Selector.java#L47,
which results in an exception being thrown.

This PR will restore the reactor initialization to call the intended
https://github.com/socketry/nio4r/blob/v2.5.2/ext/nio4r/org/nio4r/Selector.java#L41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants