GithubHelp home page GithubHelp logo

erldis's Issues

undefined function erldis:connect/4

{ok, Client} = erldis:connect("localhost", 6379, "", 14).

exception error: undefined function erldis:connect/4

diff --git a/../erlang/erldis/src/erldis.erl b/./progressbar/deps/erldis/src/erldis.erl
index 2c577b0..4ca2770 100644
--- a/../erlang/erldis/src/erldis.erl
+++ b/./progressbar/deps/erldis/src/erldis.erl
@@ -16,6 +16,8 @@ connect(Host, Port) -> erldis_client:connect(Host, Port).

connect(Host, Port, Options) -> erldis_client:connect(Host, Port, Options).

+connect(Host, Port, Options, DB) -> erldis_client:connect(Host, Port, Options, DB).
+
quit(Client) -> erldis_client:stop(Client).

Unexpected results when multiple processes use the same connection

Running the test: http://gist.github.com/395747

This issue has been cropping up in production for me as of late. I use BERTRPC to handle some tasks in erlang. A redis connection through erldis is used to give access to data. BERTRPC works by spinning off a process on every RPC request it gets. I would like to avoid the overhead and risk of failure (connection limits, etc.) associated with spawning a new redis connection every time a new process is created in erlang. When multiple processes are using the connection simultaneously this sort of error crops up.

Unicode support

I would like to be able to do the following…

> UnicodeChars = "ぬるを 我が".
[12396,12427,12434,32,25105,12364]
> erldis:set(Redis, <<"key">>, UnicodeChars).
** exception error: bad argument
     in function  list_to_binary/1
        called as list_to_binary([12396,12427,12434,32,25105,12364])
     in call from erldis_binaries:to_binary/1 (src/erldis_binaries.erl, line 5)
     in call from erldis_proto:'-multibulk_cmd/1-lc$^0/1-0-'/1 (src/erldis_proto.erl, line 18)
     in call from erldis_proto:'-multibulk_cmd/1-lc$^0/1-0-'/1 (src/erldis_proto.erl, line 18)
     in call from erldis_proto:multibulk_cmd/1 (src/erldis_proto.erl, line 18)
     in call from erldis_client:scall/3 (src/erldis_client.erl, line 65)
     in call from erldis_client:sr_scall/2 (src/erldis_client.erl, line 55)

…whitout the need to do it as follows…

> UnicodeChars2 = unicode:characters_to_binary(UnicodeChars).
<<227,129,172,227,130,139,227,130,146,32,230,136,145,227,
  129,140>>
> erldis:set(Redis, <<"key">>, UnicodeChars2).               
ok

Thanks :)

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.