GithubHelp home page GithubHelp logo

redis-stream's People

Contributors

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

redis-stream's Issues

This is brilliant code

thank you so much for having a great mind and thinking with sanity. streams should be the core of any library that likely needs to process a lot of data. but, it begs the question... why isn't this just part of node-redis? could you please collaborate with the author and make that happen? it seems inane to have to use two different libraries to talk to redis.

Auth Missing

Hi,

I was trying to use the auth method but seemed not working, then I saw that into the code is missing the logic to take care about the auth part.
I also tried to add it by myself and it worked with two lines of code, am I missing something or there are better ways to achieve this goal?

Many Thanks Guys!

PS.
This is what I've done:

function Redis (port, host, db, auth) {
this.port = port || 6379
this.host = host || 'localhost'
this.db = String(db || 0)
this.auth = auth || ''
return this
}

...
stream.redis = _redis
stream.redis.write(Redis.parse([ 'auth', this.auth ]))
stream.redis.write(Redis.parse([ 'select', this.db ]))
return stream
...

Is anything required to make get/mget work?

var express = require('express');
var Redis = require('redis-stream');

var app = express();

var client = new Redis(6379, 'localhost');

app.get('/account', function (req, res) {
    console.log('Request');

    var stream = client.stream('mget');

    stream.pipe(Redis.es.join('\r\n')).pipe(res);

    stream.write(['56b4f9698b02003d23cc8f17:listings', '56b4f9698b02003d23cc8f17:items']);

    stream.end();
});

app.listen(9999, function () {
    console.log('Listening...');
});

I am having trouble with express + redis-stream, but it is probably just streams in general.
I pipe the redis-stream to the express response stream, and I see the data
but the request keeps perpetually loading
I am lead to believe I need to call .end()
but if I do, it seems the pipe never makes it and everything gets closed before any data is piped

Empty OK reply gets dropped

When redis replies with a reply meaning no records are found it is +OK/r/n*0.
The replyParser function returns fn() as a result making the pipe stop altogether (filter). It seems like it is more suitable to reply with fn(null, []) since the redis docs an empty list is presumed when a key doesn't exist. (http://redis.io/topics/protocol#status-reply)

This would permit the piping to continue as expected IMO.

Does this reasoning seem sound?

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.