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

Add #flush and #sync methods to Puma::NullIO #2553

Merged
merged 1 commit into from Feb 10, 2021
Merged

Add #flush and #sync methods to Puma::NullIO #2553

merged 1 commit into from Feb 10, 2021

Conversation

olivierbellone
Copy link
Contributor

Description

Add #flush and #sync methods to Puma::NullIO.

This fixes an issue if you're using Events.null, e.g.:

i = Puma::Launcher.new(Puma::Configuration.new, {events: Puma::Events.null})
i.run

Without this patch, this would fail with:

NoMethodError: undefined method `sync' for #<Puma::NullIO:0x00007fb0cbb7cec8>
Did you mean?  sync=
from /Users/ob/workspace/ruby/puma/lib/puma/events.rb:67:in `log'

Your checklist for this pull request

  • I have reviewed the guidelines for contributing to this repository.
  • I have added an entry to History.md if this PR fixes a bug or adds a feature. If it doesn't need an entry to HISTORY.md, I have added [changelog skip] or [ci skip] to the pull request title.
  • I have added (or updated) appropriate tests if this PR fixes a bug or adds a feature.
  • My pull request is 100 lines added/removed or less so that it can be easily reviewed.
  • If this PR doesn't need tests (docs change), I added [ci skip] to the title of the PR.
  • If this closes any issues, I have added "Closes #issue" to the PR description or my commit messages.
  • I have updated the documentation accordingly.
  • All new and existing tests passed, including Rubocop.

@olivierbellone
Copy link
Contributor Author

The "windows-2019 2.7 no SSL" CI failure looks unrelated, AFAICT.

@nateberkopec nateberkopec added bug waiting-for-review Waiting on review from anyone labels Feb 10, 2021
@nateberkopec nateberkopec merged commit 7c91d90 into puma:master Feb 10, 2021
@olivierbellone
Copy link
Contributor Author

@nateberkopec Thanks for the quick review and merge! Do you think it would be useful to add more methods to NullIO to better mimic IO / StringIO, even if those methods are not used by Puma itself? If so I could open a followup PR.

@dentarg
Copy link
Member

dentarg commented Feb 10, 2021

@olivierbellone I think so! I did #2520 after I found out NullIO didn't have #string, which I discovered while testing rack stuff.

@nateberkopec
Copy link
Member

Seems like we'll need it eventually so that's fine by me @olivierbellone

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug waiting-for-review Waiting on review from anyone
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants