Skip to content

Commit

Permalink
Merge pull request #44 from dpatti/flush-unsets-yield
Browse files Browse the repository at this point in the history
  • Loading branch information
seliopou committed Jul 18, 2018
2 parents 0a2feb7 + d001dfa commit 0677002
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/faraday.ml
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ let flush_buffer t =
end

let flush t f =
t.yield <- false;
flush_buffer t;
if Buffers.is_empty t.scheduled then f ()
else Flushes.enqueue (t.bytes_received, f) t.flushed
Expand Down
4 changes: 3 additions & 1 deletion lib/faraday.mli
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,9 @@ val yield : t -> unit
val flush : t -> (unit -> unit) -> unit
(** [flush t f] registers [f] to be called when all prior writes have been
successfully completed. If [t] has no pending writes, then [f] will be
called immediately. *)
called immediately. If {!yield} was recently called on [t], then the effect
of the [yield] will be ignored so that client code has an opportunity to
write pending output, regardless of how it handles [`Yield] operations. *)

val close : t -> unit
(** [close t] closes [t]. All subsequent write calls will raise, and any
Expand Down

0 comments on commit 0677002

Please sign in to comment.