Re: Asynchronous downloading and parsing of XML
Re: Asynchronous downloading and parsing of XML
- Subject: Re: Asynchronous downloading and parsing of XML
- From: Mikkel Islay <email@hidden>
- Date: Mon, 08 Aug 2011 18:59:08 +0200
Thanks for the explanation, Jens too.
The hint that NSXMLParser has that behaviour is that it accepts an NSInputStream, or that it relies on a delegate for communicating "parse-events"?
Mikkel
On 8 Aug 2011, at 10:34, Andreas Grosam wrote:
> No. Asynchronous routines can be implemented above a blocking interface. Blocking and asynchronous interfaces work well together, and you may not even notice the existence of a blocking interface since it is working under the hood as an implementation detail.
>
> For instance the parser *could* (we don't know) be implemented as a "recursive decent" parser. This kind of parser will effectively require that the parsing routine blocks, when there is no further input available, since the state of the parser will be in its call stack. So you can't just stop and exit the parse function in the middle of a stream, and then continue with a newly invoked method when more data is available.
>
> The parser would just dispatch its events on the main thread where the delegate can handle them. So, from the view point of the delegate, it looks like an asynchronous interface.
>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden