Bug 63636 - Provide priority job queue
Summary: Provide priority job queue
Status: RESOLVED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Resources (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Platform-Resources-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-05-24 03:12 EDT by Gunnar Wagenknecht CLA
Modified: 2004-05-25 16:20 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gunnar Wagenknecht CLA 2004-05-24 03:12:46 EDT
The new jobs API allows to define and schedule jobs. The open source ClearCase 
plugin uses these jobs to fetch data for a resource in the background. 

It is possible that as many jobs as project resources are scheduled (I saw a 
lot more than 100 jobs). A scheduling rule ensures that only one 
update/refresh operation is ongoing (because of JNI and other limits). Even if 
the custom jobs provide a correct hashCode and equals implementation duplicate 
jobs (for the same resource) might be added because there is no API to check 
if a specific job is already schedulded.

It would be nice if it is possible to define a job queue where all these jobs 
are attached to and only the job queue shows up in the progress view. This 
queue could also provide priority processing. It sleeps if no jobs are queued 
and it wakes up if the a job is queued.

I think of a simple subclass of Job that implements this queue behavior. It 
allows to queue other jobs with a priority and it checks for duplicates.
Comment 1 John Arthorne CLA 2004-05-25 16:20:25 EDT
I considered this very early on during the jobs API development, and in fact,
many jobs currently do something just like this. It doesn't add a huge value to
put it in the API though... apart from a free priority queue implementation, you
can just create a job to do this yourself. With the PriorityQueue that is added
in JDK 1.5, you can write this with only a couple of lines of code.