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 doesn't have pending requests.

-- 
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-discussions+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/c1ea5c69-50db-47ff-bd6a-91b17b52600d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 Almog wrote:
> 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 group and stop receiving emails from it, send an email 
to codenameone-discussions+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/c86224d3-9be3-4ea3-b3b1-e7f29ca1c4f6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 group and stop receiving emails from it, send an email 
to codenameone-discussions+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/3468281e-a19a-499f-8b46-c9d13156bf41%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 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-discussions+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/58706767-dcd2-422f-9b94-96f425397a47%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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-discussions+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/76867ff2-222b-4721-b358-1495f56b438b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 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 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to codenameone-discussions+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/d70ba182-041f-445e-946b-3bb22959cb27%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to codenameone-discussions+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/28c4a042-1512-49ba-b7ae-ee3c977c3f30%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 no 
longpoling, this response is received immediately) but the UI does not 
update as the connectionrequest is waiting to received the response for the 
first request( longlong). 

this gives an effect of freeze.

HOw to update the UI, even though another request is waiting for its 
 response.

On Tuesday, November 8, 2016 at 6:46:20 AM UTC+1, Shai Almog wrote:
>
> 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 emails from it, send an email 
to codenameone-discussions+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/5f3610b4-ff1b-41c5-80a0-eeb19ae31fd2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 emails from it, send an email 
to codenameone-discussions+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/a452d920-096e-49fc-9aa2-710770e86b2f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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()". 
> 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() 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 you 
> expect for the first one to return.
> 
> 
> Better to do your polling asynchronously.
> 
> 
> Steve
> 
> 
> 
> 
> On Thu, Nov 3, 2016 at 8:26 AM, CODENAME1  wrote:
> 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 front end.
> 
> 
> 
> How can two request work and update ui independently.
> 
> 
> 
> I have set updatethreadcount(4).
> 
> 
> 
> --
> 
> 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-discussions+unsubscr...@googlegroups.com.
> 
> Visit this group at https://groups.google.com/group/codenameone-discussions.
> 
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/codenameone-discussions/f114c572-9816-4aee-9c96-02a9adaac461%40googlegroups.com.
> 
> For more options, visit https://groups.google.com/d/optout.
> 
> 
> 
> 
> 
> -- 
> 
> 
> Steve Hannah
> Software Developer
> Codename One
> http://www.codenameone.com
> 
> 
> 
> 
> 
> -- 
> 
> 
> Steve Hannah
> Software Developer
> Codename One
> http://www.codenameone.com

-- 
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-discussions+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/a907f168-a2d7-4c77-9bf2-e038a97e120e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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() 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 you expect for the first one to return.
>
> Better to do your polling asynchronously.
>
> Steve
>
> On Thu, Nov 3, 2016 at 8:26 AM, CODENAME1 
> wrote:
>
>> 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
>> front end.
>>
>> How can two request work and update ui independently.
>>
>> I have set updatethreadcount(4).
>>
>> --
>> 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-discussions+unsubscr...@googlegroups.com.
>> Visit this group at https://groups.google.com/grou
>> p/codenameone-discussions.
>> To view this discussion on the web visit https://groups.google.com/d/ms
>> gid/codenameone-discussions/f114c572-9816-4aee-9c96-02a9adaa
>> c461%40googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> Steve Hannah
> Software Developer
> Codename One
> http://www.codenameone.com
>



-- 
Steve Hannah
Software Developer
Codename One
http://www.codenameone.com

-- 
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-discussions+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/CAGOYrKU8grCu9ZKitECEDqYuc1%3DfhQzZdVkmwWJQ4FUdNDB8ww%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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
you expect for the first one to return.

Better to do your polling asynchronously.

Steve

On Thu, Nov 3, 2016 at 8:26 AM, CODENAME1  wrote:

> 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
> front end.
>
> How can two request work and update ui independently.
>
> I have set updatethreadcount(4).
>
> --
> 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-discussions+unsubscr...@googlegroups.com.
> Visit this group at https://groups.google.com/
> group/codenameone-discussions.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/codenameone-discussions/f114c572-9816-4aee-9c96-
> 02a9adaac461%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Steve Hannah
Software Developer
Codename One
http://www.codenameone.com

-- 
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-discussions+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/CAGOYrKUfYNMCAsfw%3Doc2ooxqC%3DPx6z%3DkZUAk_pM3AkQ4gXsm8Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.