Skip to content

Commit

Permalink
Fix response_timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
attdona committed Jun 29, 2024
1 parent cc669f4 commit 272d628
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Rembus.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2203,14 +2203,15 @@ function direct(
return rpcreq(rb, RpcReqMsg(topic, data, target), exceptionerror=exceptionerror)
end

function response_timeout(condition::Distributed.Future, msg::RembusMsg)
function response_timeout(rb, condition::Distributed.Future, msg::RembusMsg)
if hasproperty(msg, :topic)
descr = "[$(msg.topic)]: request timeout"
else
descr = "[$msg]: request timeout"
end

put!(condition, RembusTimeout(descr))
delete!(rb.out, msg.id)

return nothing
end
Expand All @@ -2236,7 +2237,7 @@ end
# https://github.com/JuliaLang/julia/issues/36217
function wait_response(rb::RBHandle, msg::RembusMsg, timeout)
resp_cond = send_request(rb, msg)
t = Timer((tim) -> response_timeout(resp_cond, msg), timeout)
t = Timer((tim) -> response_timeout(rb, resp_cond, msg), timeout)
res = fetch(resp_cond)
close(t)
return res
Expand Down

0 comments on commit 272d628

Please sign in to comment.