[ssax-sxml] Delaying input with continuations
Brought to you by:
oleg
From: Mike L. <mikelin@MIT.EDU> - 2002-04-22 18:16:52
|
Hi. I am wondering about the feasibility of using continuations to let you push XML to SSAX in arbitrarily divided chunks (like you can with expat). The scenario (under Gambit) is that I am doing async socket I/O over multiple sockets in XML, so that it I can't simply hook SSAX up to a socket port since that blocks. So what I would like to do is to /pull/ some bytes from a socket (with no guarantee that they are aligned in any way related to the XML document), then /push/ them to SSAX and have SSAX tell me when (for example) an entire element has been received. My idea for how to do this with SSAX is a little crude - it involves redefining read-char to a new procedure I'll write that returns a character if available, or uses some continuation magic to return control back to the pusher if not. When more data is pushed to SSAX, I'll buffer it and return control to my read-char procedure. Then building some kind of event model should be reasonably straightforward. Anyway, I just wanted to see if this sounds sane to everyone, whether anyone has already done this, whether there is any better way to do what I want to do, and/or whether anyone else would find it useful. Thanks, Mike |