-
Notifications
You must be signed in to change notification settings - Fork 11
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
Clarify the semantics of Flow.write
when the buffer is full
#4
Comments
Sorry to hijack this issue, but I stumbled upon a similar issue: mirage-console is a FLOW, and it would be great to have its error behaviour well documented... what should happen if Mirage_console.write can only do a partial write (which may be the case if the underlying socket is a unix domain socket)? The implementations differ:
The majority (of console implementations) is in favor of blocking until all bytes are written. It would IMHO be very sensible to have a common behaviour amongst all implementations of |
//cc @mato ups, looking deeper into solo5, it turns out that console_write is using the hypercall puts, which is implemented to return
|
I have a fix proposal for the issue I mentioned above, spanning over 3 PRs: Solo5/solo5#196 mirage/mirage-solo5#19 mirage/mirage-console-solo5#12 |
This is pretty old issue, but for network streams my opinion is that Indeed, we should clarify this in the documentation. |
adressed in 7a4eb61 - the call to |
CHANGES: - move Mirage_flow.stats and pp_stats to Mirage_flow_combinators (mirage/mirage-flow#51 @hannesm) - improve documentation of expected semantics (when write promise is resolved, what is done to the underlying flow - addresses mirage/mirage-flow#4 @samoht), (mirage/mirage-flow#51 @reynir @dinosaure @hannesm) - add < coercion to shutdown: ``shutdown : flow -> [< `read | `write | `read_write ] -> unit Lwt.t`` (requested mirage/mirage-flow#50 @reynir, mirage/mirage-flow#52 @hannesm)
CHANGES: - move Mirage_flow.stats and pp_stats to Mirage_flow_combinators (mirage/mirage-flow#51 @hannesm) - improve documentation of expected semantics (when write promise is resolved, what is done to the underlying flow - addresses mirage/mirage-flow#4 @samoht), (mirage/mirage-flow#51 @reynir @dinosaure @hannesm) - add < coercion to shutdown: ``shutdown : flow -> [< `read | `write | `read_write ] -> unit Lwt.t`` (requested mirage/mirage-flow#50 @reynir, mirage/mirage-flow#52 @hannesm)
In
Fflow.write
will fill the buffer and returneof
if the buffer is full.Lwt_io_flow.write
will fill the buffer and then block. One of them is wrong and need to be fixed.The text was updated successfully, but these errors were encountered: