From e6b76cad48180ce348b44840fb3d32a2bfaae526 Mon Sep 17 00:00:00 2001 From: David Anthoff Date: Wed, 8 Jan 2025 20:09:06 -0800 Subject: [PATCH] Also allow Int as id type --- src/core.jl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/core.jl b/src/core.jl index 5d5f3e19..482ccea3 100644 --- a/src/core.jl +++ b/src/core.jl @@ -108,7 +108,7 @@ end struct Request method::String params::Union{Nothing,Dict{String,Any},Vector{Any}} - id::Union{Nothing,String} + id::Union{Nothing,String,Int} token::Union{CancellationTokens.CancellationToken,Nothing} end @@ -120,8 +120,8 @@ mutable struct JSONRPCEndpoint{IOIn <: IO,IOOut <: IO} in_msg_queue::Channel{Request} outstanding_requests::Dict{String,Channel{Any}} # These are requests sent where we are waiting for a response - cancellation_sources::Dict{String,CancellationTokens.CancellationTokenSource} # These are the cancellation sources for requests that are not finished processing - no_longer_needed_cancellation_sources::Channel{String} + cancellation_sources::Dict{Union{String,Int},CancellationTokens.CancellationTokenSource} # These are the cancellation sources for requests that are not finished processing + no_longer_needed_cancellation_sources::Channel{Union{String,Int}} err_handler::Union{Nothing,Function} @@ -138,8 +138,8 @@ JSONRPCEndpoint(pipe_in, pipe_out, err_handler = nothing) = Channel{Any}(Inf), Channel{Request}(Inf), Dict{String,Channel{Any}}(), - Dict{String,CancellationTokens.CancellationTokenSource}(), - Channel{String}(Inf), + Dict{Union{String,Int},CancellationTokens.CancellationTokenSource}(), + Channel{Union{String,Int}}(Inf), err_handler, :idle, nothing,