adjust changes in 8027e48 so that we see intermediate

output during flushes instead of collecting the entire
contents of the buffer before flushing (at least in the
more common case)

original commit: a12f77f36e5e88d55ebdde0a8ec6e4a6ca708394
This commit is contained in:
Robby Findler 2014-11-25 22:15:57 -06:00
parent 5fdcd73a84
commit 6249eaa3fe

View File

@ -2647,21 +2647,24 @@
(split-queue converter q))
(cond
[flush-keep-trying?
(cons viable-bytes (loop next-remaining-queue))]
(cond
[(channel? return-evt/to-insert-chan)
(cons viable-bytes (loop next-remaining-queue))]
[else
(define c (make-channel))
(queue-insertion viable-bytes c)
(channel-put c #f)
(loop next-remaining-queue)])]
[else
(set! remaining-queue next-remaining-queue)
(list viable-bytes)])))
(cond
[(channel? return-evt/to-insert-chan)
(channel-put return-evt/to-insert-chan viable-bytess)]
[else
(let loop ([viable-bytess viable-bytess])
(cond
[(null? (cdr viable-bytess))
(queue-insertion (car viable-bytess) return-evt/to-insert-chan)]
[else
(queue-insertion (car viable-bytess) always-evt)
(loop (cdr viable-bytess))]))])
(cond
[(channel? return-evt/to-insert-chan)
(list viable-bytes)]
[else
(queue-insertion viable-bytes return-evt/to-insert-chan)
#f])])))
(when (channel? return-evt/to-insert-chan)
(channel-put return-evt/to-insert-chan viable-bytess))
(loop remaining-queue (current-inexact-milliseconds))))
(handle-evt
clear-output-chan