Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ keywords = ["Swagger", "OpenAPI", "REST"]
license = "MIT"
desc = "OpenAPI server and client helper for Julia"
authors = ["JuliaHub Inc."]
version = "0.2.5"
version = "0.2.6"

[deps]
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
Expand Down
9 changes: 7 additions & 2 deletions src/client/httplibs/juliaweb_http.jl
Original file line number Diff line number Diff line change
Expand Up @@ -373,9 +373,14 @@ function _http_streaming_request(ctx, method, url, headers, body, timeout, bytes
# read-idle timeout. Mirrors the `:downloads` backend, which interrupts
# its download task on channel close.
try
# Block until the consumer closes the channel. Do NOT use
# `wait(stream_to)`: it returns as soon as data is AVAILABLE, so
# while an event sits in the channel not yet consumed, a
# wait+yield loop degenerates into a hot spin that burns a full
# core in scheduler/syscall overhead. Poll `isopen` instead;
# 250ms of extra abort latency is irrelevant here.
while isopen(stream_to)
wait(stream_to)
yield()
sleep(0.25)
end
catch ex
isa(ex, InvalidStateException) || rethrow(ex)
Expand Down
Loading