juliadatabases / redis.jl Goto Github PK
View Code? Open in Web Editor NEWA fully-featured Redis client for the Julia programming language
License: Other
A fully-featured Redis client for the Julia programming language
License: Other
julia> using Redis
[ Info: Precompiling Redis [0cf705f9-a9e2-50d1-a699-2b372a39b750]
WARNING: Method definition exec(Redis.TransactionConnection) in module Redis at /home/sgao/.julia/packages/Redis/11fSs/src/client.jl:200 overwritten at /home/sgao/.julia/packages/Redis/11fSs/src/commands.jl:337.
** incremental compilation may be fatally broken for this module **
I need to define some callback functions on key expiration events. Is it possible using this package?
Hi there,
I'm using version 0.0.2 with Julia 0.4.1 and I'm getting lots of deprecation warnings which clutter up a log file for a script I run daily.
I see this problem has been fixed for version 0.0.3, and that there are no outstanding issues for version 0.0.3. Does this mean that version 0.0.3 is ready to go?
It'd be great to eliminate the deprecation warnings from the log file.
Cheers,
Jock
Hi,
I was wondering if this could be usable with RedisGraph ?
In the most basic way, RedisGraph will only need the ability to pass raw Redis commands.
Otherwise, a serie of Keywords may be added.
https://oss.redislabs.com/redisgraph/#using-redisgraph
Regards
julia> Pkg.add("redis")
Updating registry at ~/.julia/registries/General
Updating git-repo https://github.com/JuliaRegistries/General.git
ERROR: The following package names could not be resolved:
name=uuid
.Tried installing from url as well. No cigar.
shuts server down but generates ERROR: Redis.ProtocolException("Invalid response received: ")
both in master and the last tagged version.
I'll deal with this in the next PR.
RedisConnection
should have an optional parameter allowing users to set the timeout on the underlying TcpSocket.
When I do
using Redis
There are like 20 warnings saying
WARNING: Base.String is deprecated, use AbstractString instead.
I guess there's some small modification needed to comply with v0.4, but I could be wrong.
When testing transactions we get the following error (I have obfuscated our host ip):
julia> using Redis
julia> using Base.Test
julia> trans = open_transaction(conn)
TransactionConnection("",6379,"",0,TcpSocket(active, 0 bytes waiting))
julia> @test set(trans, "testkey", "foobar") == "QUEUED"
julia> @test get(trans, "testkey") == "QUEUED"
julia> @test exec(trans) == ["OK", "foobar"]
ERROR: test error during exec(trans) == ["OK","foobar"]
EXEC not defined
in exec at /home/ubuntu/.julia/v0.3/Redis/src/commands.jl:298
in anonymous at test.jl:62
in do_test at test.jl:37
julia> disconnect(trans)
Hello,
Are there any plans for Julia 0.6?
Is there someone already working on it?
Thank you,
smldis
This package was removed from the General registry. Is it possible to re-register it now that it's compatible with julia 1.0?
I am running julia 0.6.1 on Ubuntu-17.04-amd64.
After Pkg.add("Redis")
the package load fails:
ERROR: LoadError: LoadError: UndefVarError: symbol not defined
Stacktrace:
[1] include_from_node1(::String) at ./loading.jl:576
[2] include(::String) at ./sysimg.jl:14
[3] include_from_node1(::String) at ./loading.jl:576
[4] eval(::Module, ::Any) at ./boot.jl:235
[5] _require(::Symbol) at ./loading.jl:490
[6] require(::Symbol) at ./loading.jl:405
while loading /opt/julia-0d7248e2ff/share/julia/site/v0.6/Redis/src/commands.jl, in expression starting on line 13
while loading /opt/julia-0d7248e2ff/share/julia/site/v0.6/Redis/src/Redis.jl, in expression starting on line 61
Great library - thank you for writing! It's not Julia 1.0 compliant, so I've created a fork with updates - it is WIP right now but most of the functionality works - Redis.jl fork. If it looks good I can make a PR to update your repo.
For continued maintenance, what are your thoughts on moving this to JuliaDatabases organization? You put a lot of work into it and wouldn't want it to go to waste.
When I install Redis via Pkg.add("Redis") I get version 0.0.1. Creating a RedisConnection() returns a message that RedisConnection() is not defined.
I only managed to get it to work with Pkg.clone("https://github.com/jkaye2012/Redis.jl.git")
At this point it's still version 0.0.1 that's installed, but this way it works.
Hi,
I am totally new to Redis so forgive me if this is a lame question 😅
I have an instance myType of type MyType. I think it would be cool if set(conn,"myType",myType)
followed by get(conn,"myType")
would return an instance of MyType.
Would that go against the Redis philosophy? Would there be an interest in a PR that would allow that?
Cheers,
Eric
parser.jl: return bytestring(b[1:end-2])
generates a deprecation warning:
bytestring(v::Vector{UInt8}) is deprecated, use String(copy(v)) instead
Using Julia version 0.5.0, x86_64-pc-linux-gnu
Thanks!
I am calculating some realtime data via julia , but after i finish my process i have to convert this data to protocol buffers than set it to redis.
The :value field of the set() function at redis.jl only works with String data, i know, but after i convert my binary data to string then set it to redis, reading it again from another environment (such as javascript), it fails!
Let me write an example code also ;
using ProtoBuf
using Redis
type MyType
intval::Int
strval::AbstractString
MyType() = new()
MyType(i,s) = new(i,s)
end
iob = PipeBuffer();
writeproto(iob,MyType(10,"Hello_world"))
conn = RedisConnection(;host="127.0.0.1", port=6371, db=1)
set(conn, "doga", string(iob.data)) ## instead iob.data i have tried many other variations also
Do you have any suggestions about this matter ? Or can u give me any advice about how should i do it.
it is ok,
julia> using Redis;
julia> conn = RedisConnection( host="127.0.0.1", port=6379, db=0);
julia> hmset(conn,"bar",Dict{Any,Any}("1"=>0.1,"a"=>"b"))
true
julia> hgetall(conn,"bar")
Dict{AbstractString,AbstractString} with 2 entries:
"1" => "0.1"
"a" => "b"
but i want to use save ,
julia> @redisfunction "bgsave"
ERROR: UndefVarError: @redisfunction not defined
julia> send_command(conn,"save")
ERROR: UndefVarError: send_command not defined
julia> send_command(conn,"save")
ERROR: UndefVarError: send_command not defined
julia> versioninfo()
Julia Version 0.4.0
Commit 0ff703b* (2015-10-08 06:20 UTC)
Platform Info:
System: Windows (x86_64-w64-mingw32)
CPU: Intel(R) Xeon(R) CPU E5-2630 v2 @ 2.60GHz
WORD_SIZE: 64
BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Sandybridge)
LAPACK: libopenblas64_
LIBM: libopenlibm
LLVM: libLLVM-3.3
I'm thinking of trying to interactive with a Redis server in one of my Julia packages.
Do you have any plans to update this package to 0.6?
Thanks
Relevant output:
julia> using Redis
WARNING: deprecated syntax "abstract RedisException<:Exception" at /home/koz/.julia/v0.6/Redis/src/exceptions.jl:2.
Use "abstract type RedisException<:Exception end" instead.
WARNING: deprecated syntax "abstract RedisConnectionBase" at /home/koz/.julia/v0.6/Redis/src/connection.jl:4.
Use "abstract type RedisConnectionBase end" instead.
WARNING: deprecated syntax "abstract SubscribableConnection<:RedisConnectionBase" at /home/koz/.julia/v0.6/Redis/src/connection.jl:5.
Use "abstract type SubscribableConnection<:RedisConnectionBase end" instead.
INFO: Recompiling stale cache file /home/koz/.julia/lib/v0.6/DataStructures.ji for module DataStructures.
ERROR: LoadError: LoadError: UndefVarError: symbol not defined
Stacktrace:
[1] include_from_node1(::String) at ./loading.jl:576
[2] macro expansion at ./REPL.jl:97 [inlined]
[3] (::Base.REPL.##1#2{Base.REPL.REPLBackend})() at ./event.jl:73
while loading /home/koz/.julia/v0.6/Redis/src/commands.jl, in expression starting on line 13
while loading /home/koz/.julia/v0.6/Redis/src/Redis.jl, in expression starting on line 61
Unsubscribing from a channel leads to an ERROR: UndefVarError: unshift! not defined.
subscribe(sub, "NewTask", print)
unsubscribe(sub, "NewTask")
**ERROR: UndefVarError: unshift! not defined**
**Stacktrace:
[1] unsubscribe(::SubscriptionConnection, ::String) at C:\Users\markusb\.julia\packages\Redis\KsyS4\src\commands.jl:307
[2] top-level scope at REPL[5]:1**
This comes from here:
Line 307 in d0f4bb9
unshift! was renamed to pushfirst!, see https://stackoverflow.com/questions/63490410/julia-undefvarerror-unshift-not-defined
I hope to include the following cheat sheet in the repository (perhaps minus the development notes at the end)
Short quotes from http://redis.io/topics/protocol. The reader is strongly encouraged to read the original document. This is a cheat sheet for development reference.
Another reference that details the C language implementation of Redis Strings, entitled Hacking Strings can be found at http://redis.io/topics/internals-sds
For Redis Events and their C implementation, see http://redis.io/topics/internals-rediseventlib
+OK\r\n
-Error message\r\n
, identical to Simple Strings:1000\r\n
Note: we have "OK" and 1
$6\r\nfoobar\r\n
$0\r\n\r\n
$-1\r\n
Note: Julia this would be a Nullable{T}, where T is an Integer
or AbstractString
*2\r\n$3\r\nfoo\r\n$3\r\nbar\r\n
an Array of 2 Bulk Strings*0\r\n
is an empty Array*-1\r\n
is a Null Array, and is an alternative way to specify a Null valueSome initial thoughts, pre-refactor: it would appear that in order to improve type stability and performance, consistency with the Redis spec, and enable more features, we can leverage Julia's type system. Instead of parsing lines through a switch statement, which is the current pattern found in parser.jl, and returning some form of Any
, we could create a (parametrized) RedisReply
, atomic subtypes RedisInteger
, RedisString
, RedisNil
, etc..., and respective parametrized RedisArrays
/ RedisContainers
. Parsing would be handled by the respective constructors.
These types would then be used when specifying the response type expected for a given command in the commands.jl file. I believe this would improve a Julia program's downstream handling of responses by making types known from the get-go. We could also improve the user experience when handling the much maligned 'NIL'.
Now that a more comprehensive testing suite is available, it may be easier to implement this next stage of the package's refactor.
TODO: next section "Sending Commands to Redis"
Hello,
We know Redis has suport to pipelines
http://redis.io/topics/pipelining
I'd like to know if there's an implementation to Redis.jl for pipelining too. Since we used the Ruby Redis code with this feature and we had a better result(less time to load the data) than using the same code on the Julia implementation
Ruby: https://gist.github.com/raphapr/2ced51ce5b8a6eedf4af
Julia: https://gist.github.com/raphapr/ecd238436021157805ea
Thanks
v0.0.1 does not work with julia 0.4, had to install as an unregistered package
Hi, sometimes Redis requests are taking 300 ms to execute and i don't understand why.
I run a simple request 10.000 times (the code of the request is below) and it took me :
Do you know why ?
using Redis, Dates
conn = RedisConnection()
Redis.execute_command(conn,["FLUSHDB"])
for i in 1:10000
t1 = Dates.now()
q = string("CREATE (:Type {nature :'Test',val:'test'})")
res = Redis.execute_command(conn,[ "GRAPH.QUERY", "GraphDetection", q])
duration = Dates.now()-t1
end
Thanks in advance for your advices
Is RedisConnection with multiple threads (for reading) safe?
I am trying to expedite reading different keys in a 8 core machine but it's crashing in a threaded environment.
Case 1: Using same connection (crashes)
connection = RedisConnection(host="127.0.0.1", port=6379, db=0, password="")
Threads.@threads for i in 1:10
members = smembers(connection, some_key)
end
Case 2: Using separate connection (crashes)
connections = Vector{RedisConnection}(undef, 10)
for i in 1:10
connections[i] = RedisConnection(host="127.0.0.1", port=6379, db=0, password="")
end
Threads.@threads for i in 1:10
members = smembers(connection[i], some_key)
end
I am not sure if it's package specific issue so apologize if it doesn't belong here.
Thanks!
Resolving package versions...
ERROR: Unsatisfiable requirements detected for package Redis [0cf705f9]:
Redis [0cf705f9] log:
├─possible versions are: [0.0.1-0.0.2, 0.1.0-0.1.1] or uninstalled
├─restricted to versions * by an explicit requirement, leaving only versions [0.0.1-0.0.2, 0.1.0-0.1.1]
└─restricted by julia compatibility requirements to versions: uninstalled — no versions left
Stacktrace:
[1] #propagate_constraints!#61(::Bool, ::Function, ::Pkg.GraphType.Graph, ::Set{Int64}) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/GraphType.jl:1005
[2] propagate_constraints! at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/GraphType.jl:946 [inlined]
[3] #simplify_graph!#121(::Bool, ::Function, ::Pkg.GraphType.Graph, ::Set{Int64}) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/GraphType.jl:1460
[4] simplify_graph! at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/GraphType.jl:1460 [inlined]
[5] macro expansion at ./logging.jl:311 [inlined]
[6] resolve_versions!(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/Operations.jl:339
[7] #add_or_develop#58(::Array{Base.UUID,1}, ::Function, ::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/Operations.jl:1163
[8] #add_or_develop at ./none:0 [inlined]
[9] #add_or_develop#13(::Symbol, ::Bool, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/API.jl:64
[10] #add_or_develop at ./none:0 [inlined]
[11] #add_or_develop#12 at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/API.jl:29 [inlined]
[12] #add_or_develop at ./none:0 [inlined]
[13] #add_or_develop#11(::Base.Iterators.Pairs{Symbol,Symbol,Tuple{Symbol},NamedTuple{(:mode,),Tuple{Symbol}}}, ::Function, ::Array{String,1}) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/API.jl:28
[14] #add_or_develop at ./none:0 [inlined]
[15] #add_or_develop#10 at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/API.jl:27 [inlined]
[16] #add_or_develop at ./none:0 [inlined]
[17] #add#18 at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/API.jl:69 [inlined]
[18] add(::String) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/API.jl:69
[19] top-level scope at none:0
hello how i can fix this?
Really nice library and we have been using it in production to update our redis servers, but it's got some issues when retrieving lots of data. Additionally, when errors do occur, the TcpSocket buffer isn't cleared so the next request fails. There are no issues we have seen when making small requests so our solution thus far has been to limit response size to at most 100 items.
Consider the following
julia> for i=1:10000
lpush(conn,"test_list",string("list_item:",i))
end
julia> lrange(conn,"test_list",0,-1)
ERROR: ProtocolException("$14")
in parse_array_reply at /home/ubuntu/.julia/v0.3/Redis/src/parser.jl:77
in parse_reply at /home/ubuntu/.julia/v0.3/Redis/src/parser.jl:18
in execute_command at /home/ubuntu/.julia/v0.3/Redis/src/connection.jl:104
in lrange at /home/ubuntu/.julia/v0.3/Redis/src/client.jl:68
julia> lrange(conn,"test_list",0,-1)
ERROR: ProtocolException("\r\nlist_item:9380\r\n$14\r\nlist_item:9379\r\n$14\r\nlist_item:9378\r\n$14\r\nlist_item:9377\r\n$14\r\nlist_item:9376\r\n$14\r\nlist_item:9375\r\n$14\r\nlist_item:9374\r\n$14\r\nlist_item:9373\r\n$14\r\nlist_item:9372\r\n$14\r\nlist_item:9371\r\n$14\r\nlist_item:9370\r\n$14\r\nlist_item:9369\r\n$14\r\nlist_item:9368\r\n$14\r\nlist_item:9367\r\n$14\r\nlist_item:9366\r\n$14\r\nlist_item:9365\r\n$14\r\nlist_item:9364\r\n$14\r\nlist_item:9363\r\n$14\r\nlist_item:9362\r\n$14\r\nlist_item:9361\r\n$14\r\nlist_item:9360\r\n$14\r\nlist_item:9359\r\n$14\r\nlist_item:9358\r\n$14\r\nlist_item:9357\r\n$14\r\nlist_item:9356\r\n$14\r\nlist_item:9355\r\n$14\r\nlist_item:9354\r\n$14\r\nlist_item:9353\r\n$14\r\nlist_item:9352\r\n$14\r\nlist_item:9351\r\n$14\r\nlist_item:9350\r\n$14\r\nlist_item:9349\r\n$14\r\nlist_item:9348\r\n$14\r\nlist_item:9347\r\n$14\r\nlist_item:9346\r\n$14\r\nlist_item:9345\r\n$14\r\nlist_item:9344\r\n$14\r\nlist_item:9343\r\n$14\r\nlist_item:9342\r\n$14\r\nlist_item:9341\r\n$14\r\nlist_item:9340\r\n$14\r\nlist_item:9339\r\n$14\r\nlist_item:9338\r\n$14\r\nlist_item:9337\r\n$14\r\nlist_item:9336
.................
in execute_command at /home/ubuntu/.julia/v0.3/Redis/src/connection.jl:104
in lrange at /home/ubuntu/.julia/v0.3/Redis/src/client.jl:68
julia> lrange(conn,"test_list",0,-1)
10000-element Array{Any,1}:
"list_item:10000"
"list_item:9999"
"list_item:9998"
"list_item:9997"
"list_item:9996"
"list_item:9995"
"list_item:9994"
"list_item:9993"
"list_item:9992"
"list_item:9991"
"list_item:9990"
"list_item:9989"
"list_item:9988"
"list_item:9987"
"list_item:9986"
"list_item:9985"
⋮
"list_item:16"
"list_item:15"
"list_item:14"
"list_item:13"
"list_item:12"
"list_item:11"
"list_item:10"
"list_item:9"
"list_item:8"
"list_item:7"
"list_item:6"
"list_item:5"
"list_item:4"
"list_item:3"
"list_item:2"
"list_item:1"
Same happens with just about any of the redis objects.
Hi there,
Thanks for providing support for Redis!!!
I think that ordered sets should return array not the Set. By returning the Set from zrange we are loosing order which is the key reason to use ordered sets.
Dejan
Hello,
I'm trying to create a big list with
lpush(conn, "list", rand(1000000))
It took +-2 hours and the list wasn't created (the console freezes). The same doesn't happen with lower values, like 500k.
Can you give-me some advice about this? Is that a problem in Julia, Redis.jl or in my approach?
Thanks.
sscan
returns a Set, containing only two elements: an Integer cursor and an Array of values.
julia> for i in 1:100 sadd(conn, "test", "test$i") end
julia> sscan(conn, "test", 0)
Set(Any["56",Any["test20","test3","test65","test90","test30","test2","test97","test28","test61","test83"]])
julia> sscan(conn, "test", 0) |> typeof
Set{Any}
It's not easy to get the cursor and values from Set
, and I think it's a bug. For me, a better return type can be Tuple{Int, Set}
, or just Array
contains both the cursor and values as what scan
does.
Julia 0.4:
julia> using Redis
julia> c = RedisConnection()
Redis.RedisConnection("127.0.0.1",6379,"",0,TCPSocket(open, 0 bytes waiting))
julia> set(c,"foo","bar")
ERROR: MethodError: `search` has no method matching search(::Array{UInt8,1}, ::ASCIIString)
Closest candidates are:
search(::IOBuffer, ::Any)
search(::Union(Array{Int8,1},Array{UInt8,1}), ::Union(Array{Int8,1},Array{UInt8,1}), ::Any)
search(::AbstractString, ::AbstractString)
...
in parse_reply at /Users/seth/.julia/v0.4/Redis/src/parser.jl:9
in execute_command at /Users/seth/.julia/v0.4/Redis/src/connection.jl:104
in set at /Users/seth/.julia/v0.4/Redis/src/client.jl:68
I'm pretty sure this is because:
Base.readavailable(stream)
Read all available data on the stream, blocking the task only if no
data is available. The result is a "Vector{UInt8,1}".
As described in https://discourse.julialang.org/t/ann-plans-for-removing-packages-that-do-not-yet-support-1-0-from-the-general-registry/ we are planning on removing packages that do not support 1.0 from the General registry. This package has been detected to not support 1.0 and is thus slated to be removed. The removal of packages from the registry will happen approximately a month after this issue is open.
To transition to the new Pkg system using Project.toml
, see https://github.com/JuliaRegistries/Registrator.jl#transitioning-from-require-to-projecttoml.
To then tag a new version of the package, see https://github.com/JuliaRegistries/Registrator.jl#via-the-github-app.
If you believe this package has erroneously been detected as not supporting 1.0 or have any other questions, don't hesitate to discuss it here or in the thread linked at the top of this post.
i have a problem with 0.4 version
julia> conn = RedisConnection(host="127.0.0.1", port=6379, db=15)
Redis.RedisConnection("127.0.0.1",6379,"",15,TCPSocket(open, 0 bytes waiting))
julia> data =Dict("a"=>1.0,"b"=>2.0)
Dict{ASCIIString,Float64} with 2 entries:
"b" => 2.0
"a" => 1.0
julia> hmset(conn,"min",data)
ERROR: MethodError: `hmset` has no method matching hmset(::Redis.RedisConnection, ::ASCIIString, ::Dict{ASCIIString,Float64})
Closest candidates are:
hmset(::Redis.RedisConnection, ::Any, ::Dict{Any,Any})
hmset(::Redis.TransactionConnection, ::Any, ::Dict{Any,Any})
my version information:
_ _ _(_)_ | A fresh approach to technical computing
(_) | (_) (_) | Documentation: http://docs.julialang.org
_ _ _| |_ __ _ | Type "?help" for help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 0.4.0-rc4 (2015-10-04 03:14 UTC)
_/ |\__'_|_|_|\__'_| | Official http://julialang.org/ release
|__/ | x86_64-w64-mingw32
thank you!
please update it for Julia-v1.0.0
set and get function names exported by Redis package is too common, so the code using this functions without "Redis." prefix is very unclear and vexing.
If you can, please add to examples some short piece of code, which make it obvious how to get ordinary string from Nullable{String}. It will be helpful for totally newbies like me and can lower barrier to entry for Julia newcomers :)
Thank you very much!
In Redis 6 AUTH was extended to support username AUTH [username] password
See: https://redis.io/commands/auth
I notice that there's an effort to provide various database interfaces at https://github.com/JuliaDB. I'd suggest that Redis.jl is a pretty solid candidate for inclusion there.
Hello,
I found this error after trying set a list through rpush in a redis cluster:
conn = RedisConnection(host="localhost")
pipe = open_pipeline(conn)
rpush(conn,"foo","bar")
returns
ERROR: LoadError: MethodError: `convert` has no method matching convert(::Type{Redis.ServerException}, ::ASCIIString)
This may have arisen from a call to the constructor Redis.ServerException(...),
since type constructors fall back to convert methods.
Closest candidates are:
Redis.ServerException(::AbstractString, !Matched::AbstractString)
Redis.ServerException(::Any, !Matched::Any)
call{T}(::Type{T}, ::Any)
...
in parseline at /home/raphael/.julia/v0.4/Redis/src/parser.jl:50
in rpush at /home/raphael/.julia/v0.4/Redis/src/client.jl:83
in include at ./boot.jl:261
in include_from_node1 at ./loading.jl:304
in process_options at ./client.jl:308
in _start at ./client.jl:411
while loading /home/raphael/teste.jl, in expression starting on line 7
Same error with other data types.
I'd like to know if it has support to redis cluster.
Thanks
The most recent tag is over a year old.
Hi,
when running unsubscribe(foo, "bar")
I get the following error:
LoadError: MethodError: `unshift!` has no method matching unshift!(::Tuple{ASCIIString}, ::ASCIIString) Closest candidates are: unshift!(::Any, ::Any, !Matched::Any) unshift!(::Any, ::Any, !Matched::Any, !Matched::Any...) unshift!{T}(!Matched::Array{T,1}, ::Any)
I believe this could be fixed by changing the last line of unsubscribe
to:
execute_command(conn, unshift!(collect(channels), "unsubscribe"))
.
Would this have any adverse side effects?
There may be a simliarly easy-to-use alternative that keeps Redis.jl users happy and plays well.
WARNING: Base.String is deprecated, use AbstractString instead.
likely near /Users/stepa/.julia/v0.4/Redis/src/exceptions.jl:4
and elsewhere
...when trying to input a set of values where the scores are all the same.
s1
, s2
, s3
are 3 random strings:
julia> zadd(conn, testkey, Dict(0=>s1, 0=>s2, 0=>s3))
1 _this should be == 3_
julia> zrange(conn, testkey, 0, -1)
DataStructures.OrderedSet{AbstractString}(["JRabZ7yF"])
This would have shown up had the package been thoroughly tested. A workaround which will be included in a PR I should make this weekend is based on Tuple{Int64, AbstractString}
function flatten{T<:Number, U<:AbstractString}(token::Tuple{T, U}...)
r=[]
for item in token
push!(r, item[1])
push!(r, item[2])
end
r
end
and
@redisfunction "zadd" Integer key scoremembertup scorememberstup...
This solution was found to pass all tests. For example,
julia> zadd(conn, testkey, zip(zeros(1:3), [s1, s2, s3])...)
3
julia> zrange(conn, testkey, 0, -1)
DataStructures.OrderedSet{AbstractString}(["JRabZ7yF","K2CbUjk2","M9z0j23E"])
As I mentioned in another post here, I am completing a revision/refactor of the package accompanied by a thorough suite of tests that iterates through almost every Redis feature, as per the Redis.io documentation. There are literally hundreds of new tests.
There and quite a few other issues that I won't list here, but that have been resolved. The PR also resolves the 'NIL' issue and a whole bunch of related type stability issues.
Let's say I create a pipeline like this
conn = RedisConnection()
pipeline = open_pipeline(conn)
rpush(pipeline,"a")
rpush(pipeline,"b")
rpush(pipeline,"c")
rpush(pipeline,"d")
But when I try to use lrange on this pipeline, I don't get the output
lrange(pipeline,"list", 0,-1)
I still can get the data using lrange(conn,"list", 0,-1), but when using the pipeline I only get an integer number.
Is there a way to get theses values via pipeline?
julia> Pkg.add("Redis")
INFO: Cloning cache of DataStructures from https://github.com/JuliaLang/DataStructures.jl.git
INFO: Cloning cache of Redis from https://github.com/jkaye2012/Redis.jl.git
INFO: Installing DataStructures v0.4.6
INFO: Installing Redis v0.1.1
INFO: Package database updated
INFO: METADATA is out-of-date — you may not have the latest version of Redis
INFO: Use `Pkg.update()` to get the latest versions of your packages
julia> using Redis
INFO: Precompiling module DataStructures.
WARNING: symbol is deprecated, use Symbol instead.
in depwarn(::String, ::Symbol) at ./deprecated.jl:64
in symbol(::String, ::Vararg{String,N}) at ./deprecated.jl:30
in @redisfunction(::Any, ::Any, ::Expr, ::Vararg{Expr,N}) at /home/test/.julia/v0.5/Redis/src/client.jl:75
in include_from_node1(::String) at ./loading.jl:488 (repeats 2 times)
in eval(::Module, ::Any) at ./boot.jl:234
in require(::Symbol) at ./loading.jl:415
in eval(::Module, ::Any) at ./boot.jl:234
in eval_user_input(::Any, ::Base.REPL.REPLBackend) at ./REPL.jl:64
in macro expansion at ./REPL.jl:95 [inlined]
in (::Base.REPL.##3#4{Base.REPL.REPLBackend})() at ./event.jl:68
while loading /home/test/.julia/v0.5/Redis/src/commands.jl, in expression starting on line 13
WARNING: Method definition evalscript(Redis.RedisConnection, Any, Integer, Any) in module Redis at /home/test/.julia/v0.5/Redis/src/commands.jl:186 overwritten at /home/test/.julia/v0.5/Redis/src/commands.jl:190.
WARNING: Method definition exec(Redis.TransactionConnection) in module Redis at /home/test/.julia/v0.5/Redis/src/client.jl:101 overwritten at /home/test/.julia/v0.5/Redis/src/commands.jl:301.
`
Resolving package versions...
ERROR: Unsatisfiable requirements detected for package Redis [0cf705f9]:
Redis [0cf705f9] log:
├─possible versions are: [0.0.1-0.0.2, 0.1.0-0.1.1] or uninstalled
├─restricted to versions * by an explicit requirement, leaving only versions [0.0.1-0.0.2, 0.1.0-0.1.1]
└─restricted by julia compatibility requirements to versions: uninstalled — no versions left
Stacktrace:
[1] #propagate_constraints!#61(::Bool, ::Function, ::Pkg.GraphType.Graph, ::Set{Int64}) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/GraphType.jl:1005
[2] propagate_constraints! at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/GraphType.jl:946 [inlined]
[3] #simplify_graph!#121(::Bool, ::Function, ::Pkg.GraphType.Graph, ::Set{Int64}) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/GraphType.jl:1460
[4] simplify_graph! at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/GraphType.jl:1460 [inlined]
[5] macro expansion at ./logging.jl:311 [inlined]
[6] resolve_versions!(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/Operations.jl:339
[7] #add_or_develop#58(::Array{Base.UUID,1}, ::Function, ::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/Operations.jl:1163
[8] #add_or_develop at ./none:0 [inlined]
[9] #add_or_develop#13(::Symbol, ::Bool, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/API.jl:64
[10] #add_or_develop at ./none:0 [inlined]
[11] #add_or_develop#12 at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/API.jl:29 [inlined]
[12] #add_or_develop at ./none:0 [inlined]
[13] #add_or_develop#11(::Base.Iterators.Pairs{Symbol,Symbol,Tuple{Symbol},NamedTuple{(:mode,),Tuple{Symbol}}}, ::Function, ::Array{String,1}) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/API.jl:28
[14] #add_or_develop at ./none:0 [inlined]
[15] #add_or_develop#10 at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/API.jl:27 [inlined]
[16] #add_or_develop at ./none:0 [inlined]
[17] #add#18 at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/API.jl:69 [inlined]
[18] add(::String) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/API.jl:69
[19] top-level scope at none:0
hello how i can fix this?
I am using set(connection, key, value) via RedisConnection where value is a 13.923 KB string (13,917 characters). The string is getting truncated to 13.917 KB (13,911 characters). Have you seen this before?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.