[rabbitmq-discuss] 【SOS】issues about execution javascript in IPhone

Tim Watson tim at rabbitmq.com
Wed Oct 17 11:04:09 BST 2012


Hi,


On 10/17/2012 03:11 AM, Li, Chenglin wrote:
>
> Hi All
>
> we want to use RabbitMQ javascript library to IPhone, and we use 
> UIWebView to execute javascript: 
> stringByEvaluatingJavaScriptFromString, but there are some 
> restrictions for execution JS on IOS as below:
>
> /****************************************************************************/
>
> JavaScript execution time is limited to 10 seconds for each top-level 
> entry point. If your script executes for more than 10 seconds, the web 
> view stops executing the script. This is likely to occur at a random 
> place in your code, so unintended consequences may result. This limit 
> is imposed because JavaScript execution may cause the main thread to 
> block, so when scripts are running, the user is not able to interact 
> with the webpage.
>
> /***************************************************************************/
>
> I want to confirm with you :
>
> 1. Does the rabbitmq javascript library have above issues? rabbitmq 
> javascript execution time will be over 10 seconds?
>

There are a number of javascript libraries around, and some of them 
(probably?) offer non-blocking options. You might start by looking at 
http://www.rabbitmq.com/blog/2012/05/14/introducing-rabbitmq-web-stomp/. 
But you should bare in mind that it is impossible to guarantee 'how 
long' something will take when the network is involved. The workaround 
is usually to spawn a worker thread or some such, though I have idea 
what kind of approaches will be available on iOS.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20121017/fc5e0024/attachment.htm>


More information about the rabbitmq-discuss mailing list