[codenameone-discussions] Connection request freeze

2016-11-03 Thread CODENAME1
Hi, When I fire a request ( that implements long poking) which has a default timeout of 1min. And fire another request . Even though the response for the second request is received , the UI doesn't update since it waits for the response of the first request . This gives a freeze effect on the f

Re: [codenameone-discussions] Connection request freeze

2016-11-03 Thread Steve Hannah
For long polling, you probably should use "addToQueueAndWait()". This uses invokeAndBlock() under the hood which, due to technical reasons, operates as a FILO (first in last out) queue. invokeAndBlock() is great for shorter tasks, but when they start piling up, you can end up waiting longer than

Re: [codenameone-discussions] Connection request freeze

2016-11-03 Thread Steve Hannah
On Thu, Nov 3, 2016 at 11:10 AM, Steve Hannah wrote: > For long polling, you probably should use "addToQueueAndWait()". > I mean *shouldn't* use On Thu, Nov 3, 2016 at 11:10 AM, Steve Hannah wrote: > For long polling, you probably should use "addToQueueAndWait()". This > uses invokeAndBlock(

Re: [codenameone-discussions] Connection request freeze

2016-11-07 Thread niketkhatiyan
I am not using addtoqueueandwait() . I am using How can I make connectionrequest behave async On Thursday, November 3, 2016 at 7:16:21 PM UTC+1, Steve Hannah wrote: > On Thu, Nov 3, 2016 at 11:10 AM, Steve Hannah   > wrote: > > For long polling, you probably should use "addToQueueAndWait()". 

Re: [codenameone-discussions] Connection request freeze

2016-11-07 Thread Cn1
I am using addtoqueue() . How can I make connectionrequest behave async On Thursday, November 3, 2016 at 7:16:21 PM UTC+1, Steve Hannah wrote: > On Thu, Nov 3, 2016 at 11:10 AM, Steve Hannah   > wrote: > > For long polling, you probably should use "addToQueueAndWait()".  > I mean *shouldn't* us

Re: [codenameone-discussions] Connection request freeze

2016-11-07 Thread Shai Almog
addToQueue is async. I suggest opening the network monitor and looking at the requests going in/out to see what is stuck and where. -- You received this message because you are subscribed to the Google Groups "CodenameOne Discussions" group. To unsubscribe from this group and stop receiving ema

Re: [codenameone-discussions] Connection request freeze

2016-11-07 Thread CODENAME1
Looking at the network monitor, when i fire async( addtoqueue) which has a default timeout of 1min (longpoling- if there is an update , the response is received immediately else a default response is sent after 1 min ). In the mean time, if anyother request is fired( async( addtoqueue) with n

Re: [codenameone-discussions] Connection request freeze

2016-11-08 Thread Shai Almog
If you used addToQueue without wait then the request is happening on the network thread and not on the Codename One thread so the UI isn't waiting for that thread. It is waiting for something else you did in the app. -- You received this message because you are subscribed to the Google Groups

Re: [codenameone-discussions] Connection request freeze

2016-11-11 Thread CODENAME1
Is it good to write poling conenction request inside UITImer. (which will try to fetch the response at regular interval)??? or can it lead to UI freeze. On Wednesday, November 9, 2016 at 6:51:08 AM UTC+1, Shai Almog wrote: > > If you used addToQueue without wait then the request is happening on

Re: [codenameone-discussions] Connection request freeze

2016-11-11 Thread Shai Almog
If you keep it at 1 second interval which is pretty low, this won't impact the UI -- You received this message because you are subscribed to the Google Groups "CodenameOne Discussions" group. To unsubscribe from this group and stop receiving emails from it, send an email to codenameone-discuss

Re: [codenameone-discussions] Connection request freeze

2016-11-12 Thread CODENAME1
If the long poling connectionrequest(with addtoqueue)which has a default timeout of 60 sec is fired inside uitimer?!? Will it freeze or slow UI. If yes, what is the best way to handle. On Saturday, November 12, 2016 at 6:15:46 AM UTC+1, Shai Almog wrote: > If you keep it at 1 second interval whi

Re: [codenameone-discussions] Connection request freeze

2016-11-12 Thread Shai Almog
Sorry had my wires crossed with a different question on media. You don't need a UITimer in this case, just fire a callSerially when a batch of data arrives -- You received this message because you are subscribed to the Google Groups "CodenameOne Discussions" group. To unsubscribe from this gro

Re: [codenameone-discussions] Connection request freeze

2016-11-13 Thread CODENAME1
But I need to fetch the data at regular interval. thereby firing the connectionrequest after every 1 min. I do this inside a UiTimer . Is this the correct way to do..wil this freeze the ui. As the response will arrive max after 1 min On Sunday, November 13, 2016 at 4:27:16 AM UTC+1, Shai Almo

Re: [codenameone-discussions] Connection request freeze

2016-11-13 Thread Shai Almog
You mentioned long polling not polling. Long polling (which is what Steve referred to) is a VERY different technique from polling. If you use the async code the timer impact will be minimal but you might add requests while others are still pending so you should check that the network manager do