Giter Site home page Giter Site logo

txredis's People

Contributors

deldotdr avatar gregeremeev avatar ivaxer avatar jdavisp3 avatar mfenniak avatar moea avatar powdahound avatar rlotun avatar timitos avatar

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

txredis's Issues

zrangebyscore with scores and emptymultibulk

Hi!
I see exception 'object of type 'int' has no len()' when I use zrangebyscore with withscores set to True. Redis returns emptymultibulk which is "*0\r\n" when there is no results and post_process fail. Thank you.

unittests

make sure all pre-2.0 unittests pass against the 2.0 server

Handle ```ConnectionLost``` errors in ```txredis.client.RedisClient.connectionLost()```

There is a problem where, after a txredis.client.RedisClient has successfully sent a QUIT command to the Redis server, the server properly tears down the connection, and Twisted properly calls txredis.client.RedisClient.connectionLost, which calls txredis.RedisClient.failRequests, the later of which propagates the twisted.internet.error.ConnectionLost to all requests in its internal queue (txredis.RedisClient._request_queue), without seemingly bothering to check if these requests have already succeeded. This causes the deferred transactions in the internal queue to assume that their overarching RedisClient has a half-terminated TCP connection, causing thousands of errbacks to get propagated for no good reason.

Technically, the ConnectionLost is not really an error, it's just a signal sent from Twisted that the other end tore down the connection. This is precisely what is supposed to happen when you send QUIT, so this is somewhat a design flaw in txredis.

For a piece of software I develop at work, I have fixed this issue by subclassing RedisClient and overriding the connectionLost method as follows:

class MyRedisClient(txredis.client.RedisClient):
    def connectionLost(self, reason):
        trapped = reason.trap(ConnectionLost)
        if trapped:
            log.msg(
                ("Trap prevented ConnectionLost from propagating to "
                 "`RedisClient.failRequests()`. All's well."))
        else:
            super(MyRedisClient, self).connectionLost(reason)

If desired, I can gladly either fork or provide git patches, if you think that this issue merits fixing.

Thanks for creating txredis!

Move to new unified request protocol

Currently in txRedis we use a mix of the old and new protocols. Redis 2.2 has moved to using the new protocol exclusively, so we should move to that accordingly.

ImportError: cannot import name Redis

When trying to run the examples, all off them fail with:

Traceback (most recent call last):
File "demo.py", line 5, in
from txredis.protocol import Redis
ImportError: cannot import name Redis

Fix encode/decode

Do assume to decode as unicode. If the value of a key is SET with a str type, GET key should return a str type, not a unicode type.

please update pipy version ..

The version in the cheeseshop is one year old, and does not handle zsets for instance .. (and doesn't use multi bulk protocol). so not at all making use of all cool redis 2.0 features ..

could you please update it ??
(this is just in order to comfortably use pip install txredis .. but using the git is also doable with pip so this is totally not critical )

message receive from patern subscription

ther is no more possibility to know the patern that's concerned by the message.
and code may be break by the update
Maybe 2 possibility:

  • add pattern or channel in third argument like it was
  • add a pmessageReceived method

Personnaly i put same code as before

builtins.ImportError: No module named 'exceptions'

txredis 2.4 installed on python3.4 over easy_install3
after starting crossbar router, this error came up.

Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/autobahn/wamp/protocol.py", line 842, in onMessage
on_reply = txaio.as_future(endpoint.fn, _invoke_args, *_invoke_kwargs)
File "/usr/local/lib/python3.4/dist-packages/txaio/tx.py", line 408, in as_future
return maybeDeferred(fun, _args, *_kwargs)
File "/usr/local/lib/python3.4/dist-packages/twisted/internet/defer.py", line 150, in maybeDeferred
result = f(_args, *_kw)
File "/usr/local/lib/python3.4/dist-packages/crossbar/worker/router.py", line 643, in start_router_component
create_component = _appsession_loader(config)
--- ---
File "/usr/local/lib/python3.4/dist-packages/crossbar/worker/init.py", line 58, in _appsession_loader
module = importlib.import_module(module_name)
File "/usr/lib/python3.4/importlib/init.py", line 109, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 2254, in _gcd_import

File "", line 2237, in _find_and_load

File "", line 2226, in _find_and_load_unlocked

File "", line 1200, in _load_unlocked

File "", line 1129, in _exec

File "", line 1471, in exec_module

File "", line 321, in _call_with_frames_removed

File "/home/www/work/dc/example/crossbar/components/main.py", line 7, in
from helpers.util import success
File "/home/www/work/dc/example/backend/crossbar/helpers/util.py", line 6, in
from txredis.client import RedisClient
File "/usr/local/lib/python3.4/dist-packages/txredis-2.4-py3.4.egg/txredis/init.py", line 39, in

builtins.ImportError: No module named 'exceptions'

rlotun branch integration

Included in rlotun's branch:

  • Fix to protocol for accepting large multi-bulk replies. The old method would run into a maximum recursion depth runtime error when parsing large multi-bulk replies. This fix turns parsing of these replies into an while loop in rawDataReceived instead of continually flipping modes between line and raw.
  • Support for SUBSTR and APPEND commands
  • Support for Hash and Sorted Set commands
  • A few other minor fixes.

Multithreading

When I load my server with ~100 req/sec I see wrong callbacks called in 'self._request_queue.popleft().callback(reply)'. It's a multithreading script. I've spent one week trying to fix it with no success. Any suggestions?

Update:
Ooops, win32com threads was not working as I expected, sorry for wrong issue.

finish mfenniak branch

Mathieu has provided pupsub implementation. recently followed up with protocol bug fix.
Finish review and merge branch.

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.