GithubHelp home page GithubHelp logo

redis-hiredis's People

Contributors

danielspang avatar neophenix avatar pru-mike avatar songmu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

redis-hiredis's Issues

Using Redis::hiredis with more than 1024 opened file descriptors leads to infinite wait on select call

I´m using Redis::hiredis inside a mod_perl module on an Apache with more than 1000 domains.

That leads the program to have more than 1024 opened file descriptors what trigger a bug in net.c where redisContextWaitReady() call select with FD_SETSIZE, that's generally 1024 in most operating systems, making select call never return.

That was corrected less than a month ago in https://github.com/antirez/hiredis/commits/master/net.c substituting sellect by poll call.

I've done a test updating the entire net.c with lastest from antirez repo and the problem does not happen anymore.

Can you update the module ?

Regards,
Alexandre

multi/exec support

SV * _read_bulk_reply (Redis__hiredis self, redisReply *reply) {
SV *sv;
if ( reply->type == REDIS_REPLY_ERROR ) {
croak("%s",reply->str);
}

When you use MULTI/EXEC, bulk replies can include errors.

Use Alien::hiredis?

I have a distribution called Alien::hiredis which could be used by this module. See Alien for an overview of the Alien ecosystem, but the basic advantages are that the task of building and updating the hiredis library is outsourced to that module, and it can even allow you to build against a system version of hiredis if it is appropriate.

All you would need to do is use it like described here (I can provide a PR if you wish). Right now it requires hiredis 0.11.0 or newer, with an exception to disallow a system version of 0.13.0 which is a broken version. In other cases it will install a custom version of the library for Perl to use. This is configured by the alienfile.

You would not be able to affect what criteria it uses to determine whether to use the system version or install a new one, but it could be adjusted if needed, and you can conditionally fail to install based on the alien library version.

Just presenting this option in case you want to let something else worry about installing or updating the library, and allow usage of system hiredis. Thanks for your consideration.

I am unable to install with Xcode 4.5 and CLI Tools installed

I have used the Redis::hiredis module on many Linux systems, but now that I developing on a OS X Mountain Lion I am receiving the following error when I attempt to make the module. Potentially an issue with compiling with clang over gcc?

> perl Makefile.PL 
Checking if your kit is complete...
Looks good
Writing Makefile for Redis::hiredis

> make
cp lib/Redis/hiredis.pm blib/lib/Redis/hiredis.pm
/usr/bin/perl /System/Library/Perl/5.12/ExtUtils/xsubpp  -typemap /System/Library/Perl/5.12/ExtUtils/typemap -typemap typemap  Redis-hiredis.xs > Redis-hiredis.xsc && mv Redis-hiredis.xsc Redis-hiredis.c
Please specify prototyping behavior for Redis-hiredis.xs (see perlxs manual)
clang -c   -arch i386 -arch x86_64 -g -pipe -fno-common -DPERL_DARWIN -fno-strict-aliasing -fstack-protector -I/usr/local/include -Os   -DVERSION=\"0.10.2\" -DXS_VERSION=\"0.10.2\"  "-I/System/Library/Perl/5.12/darwin-thread-multi-2level/CORE"   Redis-hiredis.c
clang -c   -arch i386 -arch x86_64 -g -pipe -fno-common -DPERL_DARWIN -fno-strict-aliasing -fstack-protector -I/usr/local/include -Os   -DVERSION=\"0.10.2\" -DXS_VERSION=\"0.10.2\"  "-I/System/Library/Perl/5.12/darwin-thread-multi-2level/CORE"   dict.c
clang -c   -arch i386 -arch x86_64 -g -pipe -fno-common -DPERL_DARWIN -fno-strict-aliasing -fstack-protector -I/usr/local/include -Os   -DVERSION=\"0.10.2\" -DXS_VERSION=\"0.10.2\"  "-I/System/Library/Perl/5.12/darwin-thread-multi-2level/CORE"   hiredis.c
hiredis.c:799:31: error: second argument to 'va_arg' is of incomplete type 'void'
                    va_arg(ap,void);
                    ~~~~~~~~~~^~~~~
/usr/bin/../lib/clang/4.1/include/stdarg.h:35:50: note: expanded from macro 'va_arg'
#define va_arg(ap, type)    __builtin_va_arg(ap, type)
                                                 ^
1 error generated.
make: *** [hiredis.o] Error 1

Support for redisearch?

Hello, great module :)

Redisearch command works but some of the results are marked as 'undef'.

https://oss.redislabs.com/redisearch/Quick_Start.html

git clone --recursive https://github.com/RediSearch/RediSearch.git
cd RediSearch
make build
make run
use Redis::hiredis;
use Data::Dumper;

my $redis = Redis::hiredis->new();
   $redis->connect('127.0.0.1', 6379);

# create index
$redis->command("FT.CREATE my_index SCHEMA title TEXT body TEXT");

# add documents
$redis->command("FT.ADD my_index doc1 1.0 FIELDS title foo body bar");
$redis->command("FT.ADD my_index doc2 1.0 FIELDS title foo_2 body bar_2");

# search
my $search = $redis->command("FT.SEARCH my_index foo");

print Dumper(\$search);

$VAR1 = \[
            1,
            'doc1',
            undef
          ];

On redis-cli I get.

1) (integer) 1
2) "doc1"
3) 1) "title"
   2) "foo"
   3) "body"
   4) "bar"

Looks like some array are not getting parsed. Redisearch is pretty great and we have 0 perl client, a fix would be appreciated.

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.