Skip to content
Merged
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
13 changes: 1 addition & 12 deletions src/Curl.jl
Original file line number Diff line number Diff line change
Expand Up @@ -239,23 +239,13 @@ mutable struct gRPCRequest
max_send_message_length = 4 * 1024 * 1024,
max_recieve_message_length = 4 * 1024 * 1024,
)
!isready(grpc) && throw(
!grpc.running && throw(
gRPCServiceCallException(
GRPC_FAILED_PRECONDITION,
"gRPCCURL backend is not running, did you forget to call grpc_init()?",
),
)

# If the grpc handle is shutdown avoid acquiring the request semaphore and immediately throw an exception
if !grpc.running
throw(
gRPCServiceCallException(
GRPC_FAILED_PRECONDITION,
"Tried to make a request when the provided grpc handle is shutdown",
),
)
end

# Reduce number of available requests by one or block if its currently zero
# Also reduces the need to allocate the curl_done_reading Event for every request
# This is a 7% reduction in allocations overall
Expand Down Expand Up @@ -798,7 +788,6 @@ function Base.open(grpc::gRPCCURL)
end
end

isready(grpc::gRPCCURL) = grpc.running

max_reqs_dec(grpc::gRPCCURL) = take!(grpc.sem)
function max_reqs_inc(grpc::gRPCCURL, req::gRPCRequest)
Expand Down