-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
hey there -
thanks for putting together this lib. i was giving it a try and noticed something odd: the itemLimit option doesn't appear to do anything. i put together a quick PR w/ a failing test here --> #3
poking at the code, i noticed a couple of things:
.isLimitReached()(here) will returntrueexactly once. so callers basically never bail out (example)- breaking that
ifclause up such that we return early - e.g.if (this.isEnding){ return true; }, makes my failing test pass but when i use the module in my main project, i getUncaught Error: write after end... - ...if you add a few
console.log()calls, you instead getUncaught Error: Unexpected endfrom sax (here). so there's a race going on in there somewhere (>_<) - trying to clean up before ending by calling combinations of
this.stream.end(),this.stream._parser.close(),this.stream.removeAllListeners(), etc resulted in either an infinite loop + blown stack orUncaught Error: Unexpected endfrom sax.
fwiw, i'm running node v4.3.1 on os-x.
hope it helps!
-matt
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels