Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
behrk2
Posts: 367
Registered: ‎11-25-2009
My Device: Not Specified
Accepted Solution

Question concerning event thread

[ Edited ]

Hi Everyone,

 

I need to perform a lot of Http "Get" and "Post" requests. If I am not directly interacting with the user interface (event thread), then do I need to put the class handling the http requests in its own thread?

 

Any advice would be appreciated, thanks!

 

Developer
RexDoug
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: Question concerning event thread

You should not execute any blocking operation (like an HTTP GET or POST) or any lengthy processing in the event thread. If you do, you run the risk of allowing teh event queue to overflow while you have this thread doing something else, which will cause your app to be terminated by the system.

 

You should always start a worker thread for any HTTP operation.

 

Developer
behrk2
Posts: 367
Registered: ‎11-25-2009
My Device: Not Specified

Re: Question concerning event thread

Thanks!