| Background jobs at startup [message #277420] |
Fri, 10 December 2004 10:24  |
Eclipse User |
|
|
|
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 #277478 is a reply to message #277429] |
Sun, 12 December 2004 12:36  |
Eclipse User |
|
|
|
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
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03832 seconds