Re: API specs for suspend/resume capability

"Karl Waclawek" <[email protected]> Mon, 3 Nov 2003 16:24:40 -0500
Newsgroups gmane.text.xml.sax.devel
Message-ID <00d501c3a250$e49f62c0$9e539696@citkwaclaww2k>
> Hi Karl,
> 
> What would suspend() do?  Where would you expect to call it from?

It would stop, but not terminate, the parsing process, and it would
be called from a handler. 
 
> I'm finding it hard to imagine a scenario where such a flag could be used,
> or what it would control.

The flag would not control anything, but just allow you to know
if the parser returned because it is done, or because it was suspended.
One could maintain that state outsied the parser, but since it is part
of the parser's state - why keep it hidden and force the programmer 
to track it separately.

>  I guess you must be talking about a
> multi-threaded application - but I'm not too sure.

Actually, the opposite. If you want to use threads you can suspend/resume
without support by the underlying parser implementation.

Suspend is necessary if you want to implement a Pull API on top of SAX.
Suspend is also nice if you want to parse a little, go off and do something
else, come back and parse a little more.

You could ask the Mozilla XML team why they needed it for their version of Expat.


Karl


-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?   SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
List: sax-devel, [email protected]
See:  http://www.saxproject.org/
https://lists.sourceforge.net/lists/listinfo/sax-devel