Task/TaskService

  3 posts   Feedicon  
Replies: 2 - Last Post: March 09, 2010 19:16
by: aloleary
showing 1 - 3 of 3
 
Posted: March 08, 2010 11:20 by aloleary
Hello,
I am hoping this is the active forum - I haven't seen much activity in a while.

I have a question arount Tasks/TaskServices...

Someone mentioned that I could have Foreground and Background Tasks...

I am just wondering how does one distinguish between both using the build in SAF Task/TaskService ? - Is there something pre-existing or is it just by implementing your own TaskServices ?

Would an @Action be considered a foreground task etc..

Thanks in advance
-A-
 
Posted: March 09, 2010 05:58 by trumpetinc
You are correct. There's nothing really 'foreground' or 'background' in SAF - it's all just convention, how the input blocker gets created and what type of progress/status is displayed. In our application, I have several background task services that tie into status bars, etc... - but don't have input blockers associated with them. So these are, really, my background tasks. We then use the tasks returned by @Action methods to drive input blockers, etc... so I would consider those to be foreground tasks.
 
Posted: March 09, 2010 19:16 by aloleary
thanks... i did a bit more digging and am using the same approach..

my @Actions should be like: @Action(taskService = “foregroundTaskService”)

however I see in the docs that that should be possible but @Action does not have (taskService = anymore ???


As for the TaskServices I simply created my own TaskService with a custom ExecutorService

and then manually added it to the app context:

getContext().addTaskService(foregroundTaskService);

So the background taskServices are configured with a "pool" and the foregound just allow 1 task at a time

Does this seem ok ?

Thanks!
Replies: 2 - Last Post: March 09, 2010 19:16
by: aloleary
  • Mysql
  • Glassfish
  • Jruby
  • Rails
  • Nblogo
Terms of Use; Privacy Policy;
© 2010, Oracle Corporation and/or its affiliates
(revision 20120127.ac94057)
 
 
Close
loading
Please Confirm
Close