Skip to content

Commit

Permalink
type annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubwro committed Sep 30, 2024
1 parent 2793282 commit 55e65b8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/experimental/scoped_connection.jl
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ end
function request(
subject::String,
data = nothing;
timeout = parse(Float64, get(ENV, "NATS_REQUEST_TIMEOUT_SECONDS", string(DEFAULT_REQUEST_TIMEOUT_SECONDS)))
timeout::Union{Real, Period} = parse(Float64, get(ENV, "NATS_REQUEST_TIMEOUT_SECONDS", string(DEFAULT_REQUEST_TIMEOUT_SECONDS)))
)
request(scoped_connection(), subject, data; timeout)
end
Expand All @@ -125,7 +125,7 @@ function request(
nreplies::Integer,
subject::String,
data = nothing;
timeout = parse(Float64, get(ENV, "NATS_REQUEST_TIMEOUT_SECONDS", string(DEFAULT_REQUEST_TIMEOUT_SECONDS)))
timeout::Union{Real, Period} = parse(Float64, get(ENV, "NATS_REQUEST_TIMEOUT_SECONDS", string(DEFAULT_REQUEST_TIMEOUT_SECONDS)))
)
request(scoped_connection(), nreplies, subject, data; timeout)
end
Expand All @@ -134,7 +134,7 @@ function request(
T::Type,
subject::String,
data = nothing;
timeout = parse(Float64, get(ENV, "NATS_REQUEST_TIMEOUT_SECONDS", string(DEFAULT_REQUEST_TIMEOUT_SECONDS)))
timeout::Union{Real, Period} = parse(Float64, get(ENV, "NATS_REQUEST_TIMEOUT_SECONDS", string(DEFAULT_REQUEST_TIMEOUT_SECONDS)))
)
request(T, scoped_connection(), subject, data; timeout)
end
Expand Down
2 changes: 1 addition & 1 deletion src/jetstream/stream/info.jl
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function stream_infos(connection::NATS.Connection, subject = nothing)
result
end

function stream_names(connection::NATS.Connection, subject = nothing; timeout = 5.0)
function stream_names(connection::NATS.Connection, subject::String = nothing; timeout::Union{Real, Period} = 5.0)
result = String[]
offset = 0
req = Dict()
Expand Down
6 changes: 3 additions & 3 deletions src/reqreply/request.jl
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function request(
connection::Connection,
subject::String,
data = nothing;
timeout = parse(Float64, get(ENV, "NATS_REQUEST_TIMEOUT_SECONDS", string(DEFAULT_REQUEST_TIMEOUT_SECONDS)))
timeout::Union{Real, Period} = parse(Float64, get(ENV, "NATS_REQUEST_TIMEOUT_SECONDS", string(DEFAULT_REQUEST_TIMEOUT_SECONDS)))
)
replies = request(connection, 1, subject, data; timeout)
if isempty(replies)
Expand Down Expand Up @@ -72,7 +72,7 @@ function request(
nreplies::Integer,
subject::String,
data = nothing;
timeout = parse(Float64, get(ENV, "NATS_REQUEST_TIMEOUT_SECONDS", string(DEFAULT_REQUEST_TIMEOUT_SECONDS)))
timeout::Union{Real, Period} = parse(Float64, get(ENV, "NATS_REQUEST_TIMEOUT_SECONDS", string(DEFAULT_REQUEST_TIMEOUT_SECONDS)))
)
find_data_conversion_or_throw(typeof(data))
if NATS.status(connection) in [NATS.DRAINED, NATS.DRAINING]
Expand Down Expand Up @@ -107,7 +107,7 @@ function request(
connection::Connection,
subject::String,
data = nothing;
timeout = parse(Float64, get(ENV, "NATS_REQUEST_TIMEOUT_SECONDS", string(DEFAULT_REQUEST_TIMEOUT_SECONDS)))
timeout::Union{Real, Period} = parse(Float64, get(ENV, "NATS_REQUEST_TIMEOUT_SECONDS", string(DEFAULT_REQUEST_TIMEOUT_SECONDS)))
)
find_msg_conversion_or_throw(T)
result = request(connection, subject, data; timeout)
Expand Down

0 comments on commit 55e65b8

Please sign in to comment.