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

parser.pause() #65

Closed
wants to merge 8 commits into from
Closed

parser.pause() #65

wants to merge 8 commits into from

Conversation

pgte
Copy link

@pgte pgte commented Mar 23, 2012

Added support for parser.pause() with the following semantics:

After a parser.pause(), no events should be emitted before the next parser.resume(), even if parser.write() is invoked.

Needed to slightly modify:

  • parser.write(): to detect pauses and buffer the chunk if parser is paused.
  • parser.resume(): to resume all the pending buffers that were written while paused.
  • parser.pause(): to set the pausing state, to be detected in parser.write().

Added test test/pause.js that takes a large xml chunk, breaks it in pieces and:

  • asserts that no event is emitted while paused.
  • asserts that the order of all events is as expected.

Documented parser.pause in README.

@pgte
Copy link
Author

pgte commented Mar 23, 2012

Found this problem when .end() occurs while it's paused, will have to come back, sorry.

@pgte pgte closed this Mar 23, 2012
@pgte pgte reopened this Mar 23, 2012
@isaacs
Copy link
Owner

isaacs commented Jan 6, 2013

I'd like to pull this in, but it doesn't apply cleanly. would you mind rebasing onto the current master, and squash down to one or two commits?

@andrewrk andrewrk mentioned this pull request Jul 22, 2013
@bslayton
Copy link

bslayton commented Sep 5, 2013

Can we get this pull request accepted? I could really use parser.pause()

@lysdexia
Copy link

Anything happening with this? It would make my life complete.

@bslayton
Copy link

That's a bit humorous. parser.pause() = life complete. Sorry. Had to state the obviously cheesy. :neckbeard:

@mcouzinet
Copy link

+1 for this feature !

@isaacs
Copy link
Owner

isaacs commented Apr 21, 2015

Superseded by #107

@isaacs isaacs closed this Apr 21, 2015
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

Successfully merging this pull request may close these issues.

None yet

5 participants