Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Background jobs at startup
Background jobs at startup [message #277420] Fri, 10 December 2004 10:24 Go to next message
Eclipse UserFriend
Originally posted by: plesner.oovm.com

I am working on a plugin that needs to do a lot of work on startup. I
would like that to happen in a background job, I can't seem to find the
right time to start the job. If I start it from Plugin.start(), it
appears to start immediately and slow down the loading of the rest of
the system, making it close to unresponsive until the job finishes. I
want the job to start after the system has been completely loaded and is
ready to be used, similar to how the Java plugin builds projects on
startup. How do I do that?


Thanks,
Christian
Re: Background jobs at startup [message #277429 is a reply to message #277420] Fri, 10 December 2004 11:49 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: john.eclipsefaq.org

One approach is to schedule the job from within an asyncExec. The
asynchronous event queue does not get processed until the UI is
completely up and running. To be even kinder, you can add a further
scheduling delay to avoid a flurry of activity at the moment when the UI
becomes available to the user.

display.asyncExec(new Runnable()) {
public void run() {
job.schedule(1000);
}
});
--

Christian Plesner Hansen wrote:
> I am working on a plugin that needs to do a lot of work on startup. I
> would like that to happen in a background job, I can't seem to find the
> right time to start the job. If I start it from Plugin.start(), it
> appears to start immediately and slow down the loading of the rest of
> the system, making it close to unresponsive until the job finishes. I
> want the job to start after the system has been completely loaded and is
> ready to be used, similar to how the Java plugin builds projects on
> startup. How do I do that?
>
>
> Thanks,
> Christian
Re: Background jobs at startup [message #277478 is a reply to message #277429] Sun, 12 December 2004 12:36 Go to previous message
Eclipse UserFriend
Originally posted by: plesner.oovm.com

That works beautifully -- thanks a lot!

John Arthorne wrote:
> One approach is to schedule the job from within an asyncExec. The
> asynchronous event queue does not get processed until the UI is
> completely up and running. To be even kinder, you can add a further
> scheduling delay to avoid a flurry of activity at the moment when the UI
> becomes available to the user.
>
> display.asyncExec(new Runnable()) {
> public void run() {
> job.schedule(1000);
> }
> });
> --
>
> Christian Plesner Hansen wrote:
>
>> I am working on a plugin that needs to do a lot of work on startup. I
>> would like that to happen in a background job, I can't seem to find
>> the right time to start the job. If I start it from Plugin.start(),
>> it appears to start immediately and slow down the loading of the rest
>> of the system, making it close to unresponsive until the job
>> finishes. I want the job to start after the system has been
>> completely loaded and is ready to be used, similar to how the Java
>> plugin builds projects on startup. How do I do that?
>>
>>
>> Thanks,
>> Christian
>
>
Previous Topic:Editor
Next Topic:error plugin
Goto Forum:
  


Current Time: Wed Nov 05 17:09:30 EST 2025

Powered by FUDForum. Page generated in 0.04162 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top