Giter Site home page Giter Site logo

redis.jl's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

redis.jl's Issues

Method definition warning on Precompiling

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 **

key expiration callback

I need to define some callback functions on key expiration events. Is it possible using this package?

Version 0.0.3 ready to go?

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

install issue julia v.1.2.0

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:

  • redis (not found in project, manifest or registry)
    Please specify by known name=uuid.
    Stacktrace:
    [1] top-level scope at REPL[2]:1

Tried installing from url as well. No cigar.

shutdown error

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.

EXEC not defined

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)

Plans for v0.6?

Hello,
Are there any plans for Julia 0.6?
Is there someone already working on it?

Thank you,
smldis

Re-register package

This package was removed from the General registry. Is it possible to re-register it now that it's compatible with julia 1.0?

using Redis in julia 0.6.1 produces error

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

Julia 1.0 support and possible moving repo to JuliaDatabases

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.

get/set custom Types

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

bytestring is deprecated

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!

set() function's, String dependency

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.

ERROR: UndefVarError: @redisfunction not defined

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

Plans to update to 0.6?

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

Error on 'using Redis' in Julia 0.6.2

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

Unsubscribe gives an UndefVarError

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:

execute_command_without_reply(conn, unshift!([channel], "unsubscribe"))

unshift! was renamed to pushfirst!, see https://stackoverflow.com/questions/63490410/julia-undefvarerror-unshift-not-defined

Redis Types

I hope to include the following cheat sheet in the repository (perhaps minus the development notes at the end)

RESP (Redis Serialization Protocol)

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

  • Requests are sent from the client to the Redis server as arrays of strings representing the arguments of the command to execute.
  • Redis replies with a command-specific data type
  • binary-safe
  • uses prefixed-length to transfer bulk data
  • a serialization protocol that supports the following data types: Simple Strings, Errors, Integers, Bulk Strings and Arrays

RESP Response Types

  • send commands to a Redis server as a RESP Array of Bulk Strings
  • server replies with one of the RESP types:
    1. Simple Strings the first byte of the reply is "+"
    2. Errors the first byte of the reply is "-"
    3. Integers the first byte of the reply is ":"
    4. Bulk Strings the first byte of the reply is "$"
    5. Arrays the first byte of the reply is "*"
    6. RESP is able to represent a Null value using a special variation of Bulk Strings or Array
  • different parts of the protocol are always terminated with "\r\n" (CRLF)

Simple Strings

  • +OK\r\n
  • non binary safe strings
  • for binary safe use Bulk Strings
  • a client library should return to the caller a string composed of the first character after the '+' up to the end of the string, excluding the final CRLF bytes

Errors

  • -Error message\r\n, identical to Simple Strings
  • An exception should be raised by the library client when an Error Reply is received
  • A client implementation may return different kind of exceptions for different errors, or may provide a generic way to trap errors by directly providing the error name to the caller as a string.
    However, such a feature should not be considered vital as it is rarely useful, and a limited client implementation may simply return a generic error condition, such as false.

Integers

  • :1000\r\n
  • a CRLF terminated string representing an integer, prefixed by a ":" byte
  • guaranteed to be in the range of a signed 64 bit integer
  • used in order to return true or false

Note: we have "OK" and 1

Bulk Strings

  • $6\r\nfoobar\r\n
  • single binary safe string up to 512 MB in length
  • an empty string is $0\r\n\r\n
  • a Null, or Null Bulk String is $-1\r\n
  • The client library API should not return an empty string, but a nil object, when the server replies with a Null Bulk String. For example a Ruby library should return 'nil' while a C library should return NULL (or set a special flag in the reply object), and so forth

Note: Julia this would be a Nullable{T}, where T is an Integer or AbstractString

Arrays

  • *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
  • Arrays can contain mixed types
  • *-1\r\n is a Null Array, and is an alternative way to specify a Null value
  • client library API should return a null object and not an empty Array when Redis replies with a Null Array. This is necessary to distinguish between an empty list and a different condition (for instance the timeout condition of the BLPOP command).
  • Arrays of arrays are possible
  • Single elements of an Array may be Null: e.g., SORT command when used with the GET pattern option when the specified key is missing

Redis Types Notes

Some 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"

Requests done in 1 to 3 ms taking 300ms

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 :

  • Between 0 and 9 ms for 9290 requests
  • Between 299 and 314 ms for 710 requests

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?

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!

error in install

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?

problems with large sets, lists...

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.

zrange return

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

Create a big random list

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.

Inconvenient return type of `sscan`

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.

set() in example results in an error.

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}".

Info about upcoming removal of packages in the General registry

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.

hmset problem with 0.4

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 rewrite examples with FQ function/method names

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!

set a list in a redis cluster returns a error

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

Unsubscribe doesn't work with Julia 0.4.6

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?

Base.String is deprecated

WARNING: Base.String is deprecated, use AbstractString instead.
likely near /Users/stepa/.julia/v0.4/Redis/src/exceptions.jl:4

and elsewhere

Cannot use Dict as input for Sorted Sets...

...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.

Read data using pipeline

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?

Warning at module loading

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.
`

error in install

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?

String value being truncated

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.