[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

xmlm input function with blocking



Hi Daniel,

I was just looking into using xmlm to do incremental parsing of a large XML 
document coming in from the network.

xmlm lets custom input functions be defined:

type source = [
  | `Channel of Pervasives.in_channel
  | `Fun of unit -> int
  | `String of int * string
]
 
However, both Async and Lwt (and presumably Fut) need to signal that Fun might 
block if data is temporarily unavailable.

Do you have any thoughts on how to support this in xmlm streaming API?  A 
Would_block exception would be sufficient to signal a temporary failure, but 
then there also needs to be a function to restart the Xmlm parser from within 
the I/O loop.

-anil


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.