Skip to content

Clarify documentation around close, flush, and isopen #58020

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

Merged
merged 5 commits into from
Jun 2, 2025

Conversation

jakobnissen
Copy link
Member

@jakobnissen jakobnissen commented Apr 6, 2025

The previous documentation was unclear about what "closing" something actually meant, what you could expect from a closed resource, and whether it was usable in generic code.
It also mixed up closing IO object, timers and events, where the semantics are different.

In this commit:

  • The docstring of close and flush has been expanded.
  • close has been given a generic implementation - this was too controversial
  • The documentation details specific to IOStream, Timer and Asyncevent has been moved to specific docstrings, such that the generic behaviour of these functions aren't mixed up with the specifics of e.g. IOStream.

Closes #57944

The previous documentation was unclear about what "closing" something actually
meant, what you could expect from a closed resource, and whether it was usable
in generic code.
It also mixed up closing IO object, timers and events, where the semantics are
different.

In this commit:
* The docstring of `close` and `flush` has been expanded.
* `close` has been given a generic implementation
* The documentation details specific to `IOStream`, `Timer` and `Asyncevent`
  has been moved to specific docstrings, such that the *generic* behaviour of
  these functions aren't mixed up with the specifics of e.g. `IOStream`.
@jakobnissen jakobnissen added io Involving the I/O subsystem: libuv, read, write, etc. docs This change adds or pertains to documentation labels Apr 6, 2025
@fingolfin fingolfin added merge me PR is reviewed. Merge when all tests are passing and removed status: waiting for PR reviewer labels Jun 1, 2025
@IanButterworth IanButterworth merged commit a4c58c8 into JuliaLang:master Jun 2, 2025
9 checks passed
@IanButterworth IanButterworth removed the merge me PR is reviewed. Merge when all tests are passing label Jun 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs This change adds or pertains to documentation io Involving the I/O subsystem: libuv, read, write, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

close is underdocumented, and inconsistently implemented
4 participants