Difference between Pull Parsing and Push Parsing: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
 
(3 intermediate revisions by the same user not shown)
Line 3: Line 3:
* [[JAXP_SAX#Difference_between_Pull_Parsing_and_Push_Parsing|SAX]]
* [[JAXP_SAX#Difference_between_Pull_Parsing_and_Push_Parsing|SAX]]
* [[JAXP_StAX#Difference_between_Pull_Parsing_and_Push_Parsing|StAX]]
* [[JAXP_StAX#Difference_between_Pull_Parsing_and_Push_Parsing|StAX]]
* [[Parsing#Overview|Parsing]]


=Overview=
=Overview=
Line 10: Line 11:
Streaming ''push parsing'' refers to a programming model in which a parser sends (pushes) data to the client when the parser encounters an "interesting" structure.
Streaming ''push parsing'' refers to a programming model in which a parser sends (pushes) data to the client when the parser encounters an "interesting" structure.


With pull parsing, the application controls the application thread, and can call methods on the parser when needed. With pull parsers
With pull parsing, the application controls the application thread, and can call methods on the parser when needed. With pull parsers, the parser controls the thread and the application can only accept invocations from the parser. Thus, pull clients can read multiple documents at the same time with a single thread.

Latest revision as of 19:43, 13 June 2018

Internal

Overview

Streaming pull parsing refers to a programming model in which a client application calls a "next element"-type method on a parser.

Streaming push parsing refers to a programming model in which a parser sends (pushes) data to the client when the parser encounters an "interesting" structure.

With pull parsing, the application controls the application thread, and can call methods on the parser when needed. With pull parsers, the parser controls the thread and the application can only accept invocations from the parser. Thus, pull clients can read multiple documents at the same time with a single thread.