Skip to content

Commit e6b76ca

Browse files
committed
Also allow Int as id type
1 parent c0cd1eb commit e6b76ca

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/core.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ end
108108
struct Request
109109
method::String
110110
params::Union{Nothing,Dict{String,Any},Vector{Any}}
111-
id::Union{Nothing,String}
111+
id::Union{Nothing,String,Int}
112112
token::Union{CancellationTokens.CancellationToken,Nothing}
113113
end
114114

@@ -120,8 +120,8 @@ mutable struct JSONRPCEndpoint{IOIn <: IO,IOOut <: IO}
120120
in_msg_queue::Channel{Request}
121121

122122
outstanding_requests::Dict{String,Channel{Any}} # These are requests sent where we are waiting for a response
123-
cancellation_sources::Dict{String,CancellationTokens.CancellationTokenSource} # These are the cancellation sources for requests that are not finished processing
124-
no_longer_needed_cancellation_sources::Channel{String}
123+
cancellation_sources::Dict{Union{String,Int},CancellationTokens.CancellationTokenSource} # These are the cancellation sources for requests that are not finished processing
124+
no_longer_needed_cancellation_sources::Channel{Union{String,Int}}
125125

126126
err_handler::Union{Nothing,Function}
127127

@@ -138,8 +138,8 @@ JSONRPCEndpoint(pipe_in, pipe_out, err_handler = nothing) =
138138
Channel{Any}(Inf),
139139
Channel{Request}(Inf),
140140
Dict{String,Channel{Any}}(),
141-
Dict{String,CancellationTokens.CancellationTokenSource}(),
142-
Channel{String}(Inf),
141+
Dict{Union{String,Int},CancellationTokens.CancellationTokenSource}(),
142+
Channel{Union{String,Int}}(Inf),
143143
err_handler,
144144
:idle,
145145
nothing,

0 commit comments

Comments
 (0)