Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

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

by dragonchild (Archbishop)
on Mar 18, 2003 at 18:24 UTC ( #244098=note: print w/ replies, xml ) Need Help??


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)
Re^5: Are you looking at XML processing the right way? (merge)
by tye (Cardinal) 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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://244098]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2014-10-26 01:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (149 votes), past polls