|
2019-04-29
| ||
| 08:29 | • Closed ticket [f8fe1ebdc6]: a non-blocking chan pipe channel blocks when inter... artifact: 25df0597d1 user: pooryorick | |
| 07:56 | • Ticket [f8fe1ebdc6]: 4 changes artifact: dc7a19eab8 user: pooryorick | |
| 06:52 | • New ticket [f8fe1ebdc6]. artifact: d0354e74d0 user: pooryorick | |
a non-blocking [chan pipe] channel blocks when internal buffers fill up
variable total 0
proc write chan {
variable total
variable done
set data [info cmdcount][string repeat abcdefghijklmnopqrstuvwxyz 100]
set len [string length $data]
puts [list writing $len characters]
puts $chan $data
if {[incr total $len] > 1048576} {
close $chan
set done 1
}
}
lassign [chan pipe] pr pw
chan configure $pw -blocking 0
chan event $pw writable [list write $pw]
vwait done
puts done
The documentation for [chan write] states, "A channel is considered to be writable if at least one byte of data can be written to the underlying file or device without blocking, or if an error condition is present on the underlying file or device."
Therefore, this is the expected behaviour.