Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stream stops in the middle #115

Closed
kof opened this issue Jun 25, 2014 · 9 comments
Closed

Stream stops in the middle #115

kof opened this issue Jun 25, 2014 · 9 comments

Comments

@kof
Copy link
Contributor

kof commented Jun 25, 2014

Something goes wrong there in that node version.

Theis code works as expected in node 0.10.

var request = require('superagent')
var FeedParser = require('feedparser')

request
    .get('http://feeds.lds.org/LDSConversations')
    .on('error', console.log)
    .buffer(false)
    .on('response', function(res) {
        console.log(res.ok, res.text)

        res.on('end', function() {
            console.log('end')
        })

        var feedParser = new FeedParser()
        var articles = []
        res.pipe(feedParser)

        feedParser
            .on('error', console.log)
            .on('readable', function() {
                var article
                while (article = this.read()) {
                    articles.push(article)
                }
            })
            .on('end', function() {
                console.log('end', articles)
            })
    })
    .end()
@kof
Copy link
Contributor Author

kof commented Jun 25, 2014

The issue is actually that 'end' event is never emitted if I pipe to feedParser.

@kof
Copy link
Contributor Author

kof commented Jun 25, 2014

If I remove .pipe on node 0.11, 'end' event gets emitted.

@kof
Copy link
Contributor Author

kof commented Jun 25, 2014

Huh ... in node 0.11.12 it works "sometimes"

@kof
Copy link
Contributor Author

kof commented Jun 25, 2014

wow in 0.11.13 also sometimes .... fuck ...

@kof
Copy link
Contributor Author

kof commented Jun 25, 2014

probably node issue ... ?

@kof
Copy link
Contributor Author

kof commented Jun 25, 2014

Nope the same issue on 0.10 it just sometimes work.

@kof kof changed the title Node 0.11.13 streams support Stream stops in the middle Jul 6, 2014
@danmactough
Copy link
Owner

@kof What's the deal with this issue? Is this a superagent issue?

@kof
Copy link
Contributor Author

kof commented Jul 22, 2014

I believe yes.

@kof kof closed this as completed Jul 22, 2014
@danmactough
Copy link
Owner

@kof If you have a chance at some point to jump into the IRC channel to chat about #112 I would really appreciate it. #node-feedparser on freenode

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants