Skip to content

Commit 611d4ce

Browse files
committed
Fix issue throwing MethodError on convert_response for brpop and similar functions
1 parent 0c8ae7e commit 611d4ce

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

src/client.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,14 @@ function convert_response(::Type{Union{T, Nothing}}, response) where {T <: Abstr
9090
return response
9191
end
9292

93+
function convert_response(::Type{Union{Array{T, 1}, Nothing}}, response) where {T <: AbstractString}
94+
if response == nothing
95+
nothing
96+
else
97+
convert_response(Array{T, 1}, response)
98+
end
99+
end
100+
93101
# redundant
94102
function convert_response(::Type{Array{Union{T, Nothing}, 1}}, response) where {T<:Number}
95103
if response == nothing

src/commands.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,9 @@ end
8686
@redisfunction "hscan" Tuple{Integer, Dict{AbstractString, AbstractString}} key cursor::Integer options...
8787

8888
# List commands
89-
@redisfunction "blpop" Array{AbstractString, 1} keys timeout
90-
@redisfunction "brpop" Array{AbstractString, 1} keys timeout
91-
@redisfunction "brpoplpush" AbstractString source destination timeout
89+
@redisfunction "blpop" Union{Array{AbstractString, 1}, Nothing} keys timeout
90+
@redisfunction "brpop" Union{Array{AbstractString, 1}, Nothing} keys timeout
91+
@redisfunction "brpoplpush" Union{AbstractString, Nothing} source destination timeout
9292
@redisfunction "lindex" Union{AbstractString, Nothing} key index
9393
@redisfunction "linsert" Integer key place pivot value
9494
@redisfunction "llen" Integer key

0 commit comments

Comments
 (0)