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 Mirage_flow.shutdown: flow -> [ read | write | read_write ] -> unit Lwt.t #48

Merged
merged 1 commit into from
Dec 17, 2023

Conversation

hannesm
Copy link
Member

@hannesm hannesm commented Sep 2, 2022

Also removes SHUTDOWNABLE signature (#17)
Superseeds #18 (which proposed disconnect)

This reason for this is multi-fold, a recent issue is about HTTP/2 and how to shutdown the write direction only. Also, this interface is present in Unix.

//cc @djs55 (who mentioned that shutdown `read is not used much: I guess we could use that to save some space in the TCP stack (the receive buffer no longer needs to be present)

//cc @dinosaure who encountered the HTTP2 issue

//cc @talex5 who in mirleft/ocaml-tls#451 mentioned the lack of such functionality (and tls_lwt is close to the Mirage_flow.S signature, tls_mirage is implementing it)

And once more //cc @djs55 who has been proposing this since quite some time. I hope this PR suits you well (I've not much experience with Mirage_flow_unix and Mirage_flow_combinators, and would be keen to know whether the changes are reasonable).

If we can agree on this change, we can quickly revise the ecosystem to conform with the new interface. It'd be interesting whether we should as well revise read (as poposed in #46) to (if I understand correctly) get the buffer passed instead of allocating the underlying buffer (and thus clean up ownership methodology) //cc @haesbaert who may be interested as well.

… unit Lwt.t

Also removes SHUTDOWNABLE signature (mirage#17)
Superseeds mirage#18 (which proposed disconnect)
@hannesm hannesm changed the title Add Mirage_flow.shutdown: flow -> [ read | write | `read_write ] -> unit Lwt.t Add ` Mirage_flow.shutdown: flow -> [ read | write | read_write ] -> unit Lwt.t `` Sep 2, 2022
@hannesm hannesm changed the title Add ` Mirage_flow.shutdown: flow -> [ read | write | read_write ] -> unit Lwt.t `` Add Mirage_flow.shutdown: flow -> [ read | write | read_write ] -> unit Lwt.t Sep 2, 2022
Copy link
Member

@djs55 djs55 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, and thanks @hannesm for working on this!

@hannesm
Copy link
Member Author

hannesm commented Dec 17, 2023

I came back here, and since Dave likes the API, I'll merge and release.

@hannesm hannesm merged commit d0d68e9 into mirage:main Dec 17, 2023
@hannesm hannesm deleted the shutdown branch December 17, 2023 15:30
hannesm added a commit to hannesm/opam-repository that referenced this pull request Dec 17, 2023
…rs (4.0.0)

CHANGES:

- Add ``shutdown : flow -> [ `read | `write | `read_write ] -> unit Lwt.t``
  (@djs55 @hannesm mirage/mirage-flow#16 mirage/mirage-flow#18 mirage/mirage-flow#48)
- Remove SHUTDOWNABLE signature (@djs55 mirage/mirage-flow#17, rebased into mirage/mirage-flow#48)
hannesm added a commit to hannesm/opam-repository that referenced this pull request Dec 19, 2023
…rs (4.0.0)

CHANGES:

- Redefine `close` semantics, which no longer is a `` shutdown `read_write ``
  (mirage/mirage-flow#49 @hannesm)
- Add ``shutdown : flow -> [ `read | `write | `read_write ] -> unit Lwt.t``
  (@djs55 @hannesm mirage/mirage-flow#16 mirage/mirage-flow#18 mirage/mirage-flow#48)
- Remove SHUTDOWNABLE signature (@djs55 mirage/mirage-flow#17, rebased into mirage/mirage-flow#48)
hannesm added a commit to hannesm/opam-repository that referenced this pull request Dec 19, 2023
…rs (4.0.0)

CHANGES:

- Redefine `close` semantics, which no longer is a `` shutdown `read_write ``
  (mirage/mirage-flow#49 @hannesm)
- Add ``shutdown : flow -> [ `read | `write | `read_write ] -> unit Lwt.t``
  (@djs55 @hannesm mirage/mirage-flow#16 mirage/mirage-flow#18 mirage/mirage-flow#48)
- Remove SHUTDOWNABLE signature (@djs55 mirage/mirage-flow#17, rebased into mirage/mirage-flow#48)
nberth pushed a commit to nberth/opam-repository that referenced this pull request Jun 18, 2024
…rs (4.0.0)

CHANGES:

- Redefine `close` semantics, which no longer is a `` shutdown `read_write ``
  (mirage/mirage-flow#49 @hannesm)
- Add ``shutdown : flow -> [ `read | `write | `read_write ] -> unit Lwt.t``
  (@djs55 @hannesm mirage/mirage-flow#16 mirage/mirage-flow#18 mirage/mirage-flow#48)
- Remove SHUTDOWNABLE signature (@djs55 mirage/mirage-flow#17, rebased into mirage/mirage-flow#48)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants