in reply to Re^3: Are you looking at XML processing the right way? (merge)
in thread is XML too hard?

Now that makes more sense. But, it seems that it's not that you're missing continuations (though those would certainly help) ... it's like you're missing a layer of control over the stream itself. My naive thought was that I could tell the stream "Don't process another chunk ... I'm still working on the one you just gave me, but I need to be able to do other stuff, too." Maybe, naive is the word for it.

It sounds like there's the need for a event listener. Each stream would issue events and the listener would reap them, as appropriate. Every time an event from a stream is reaped, the stream is informed and it can then send up another event to be reaped.

The callback part of this would be that you register with the listener that you're interested in XYZ event from streams A, B, and C. The listener would discard any event from the streams that is not being listened for by anybody.

Does this already exist? Can this exist? (Well, I'm pretty sure it can, cause that's how modern OS's work ...)

We are the carpenters and bricklayers of the Information Age.

Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.

Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.

  • Comment on Re4: Are you looking at XML processing the right way? (merge)

Replies are listed 'Best First'.
Re^5: Are you looking at XML processing the right way? (merge)
by tye (Sage) on Mar 18, 2003 at 18:40 UTC

    So now you want asynchronous callbacks? Are you trying for the worst of both worlds (hard for the module writer to write and hard for the module users to use) ?

    So instead of doing a bit extra work and making iterators, you want to do extra work to make something asynchronous? And yet you want these seperate asynchrous streams to be synchronized with each other?

    I suggest you take some more time thinking about this. How does my callback return yet not say that the token has been processed? And then where/when do I get notification to the stream that I've now (asychronously) processed the token? What a nightmare!

    Or you want to replace three streams with one event stream? Which requires you to process events out of order.

    I think you still just don't get it.

                    - tye
      A year later, but I get it now. I still think that event streams could work, but I understand that iterators will work better in every conceivable case, and that's the point.

      We are the carpenters and bricklayers of the Information Age.

      Then there are Damian modules.... *sigh* ... that's not about being less-lazy -- that's about being on some really good drugs -- you know, there is no spoon. - flyingmoose