Bug 293372 - Add new Job subclass that encapsulates the common pattern of processing a dynamic list of items
Summary: Add new Job subclass that encapsulates the common pattern of processing a dyn...
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Runtime (show other bugs)
Version: 3.5   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: platform-runtime-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-26 17:32 EDT by Min Idzelis CLA
Modified: 2019-09-06 15:36 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 Min Idzelis CLA 2009-10-26 17:32:03 EDT
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3
Build Identifier: 

It is a common pattern in Eclipse to process a list (queue) of items that may change over time. A job subclass should be created to take care of sometimes complicated synchronization that is necessary to support this common programming pattern. The API should be flexible enough to accommodate different executions strategies and a way to wait for specific items to be processed. 

Reproducible: Always
Comment 1 Pascal Rapicault CLA 2009-10-27 08:26:28 EDT
Min, do you want to take a stab at providing such an API and its implementation?
Comment 2 John Arthorne CLA 2009-10-27 09:27:08 EDT
See also bug 63636. We have a few jobs in the platform that do this today, but when I looked at it before it didn't seem sufficiently interesting to deserve special support - it's only a few lines of code to have a run method that processes items in a queue... Especially for clients who can make use of the queues and other utilities in java.util.concurrent it is quite simple. If you'd like to provide one though, I can take a look at adding it if people find it useful.
Comment 3 Min Idzelis CLA 2009-10-27 10:35:42 EDT
I agree that the java.lang.concurrent apis do make it easy, especially with the free priority queue implementation in Java 5. But using the java.lang.concurrent APIs will mean that you don't get all the nice things that Jobs give you - most importantly - the progress monitor. 

It's outside the scope of this bug, but it would be nice if we could "pause" a Job. It would be similar to how cancellation is handled - it is a "request" to pause. SWT's progress indicator supports SWT.PAUSED as of 3.4. We should retrofit IProgressMonitor to support pausing. This would also mean supporting it in the UI everywhere. (Wizard dialogs/progress view and other runnable contexts)

Tying it back together - an item processing job seems very well suited to being paused, since it is natural spot to pause after processing an item from the queue.
Comment 4 Eclipse Webmaster CLA 2019-09-06 15:36:52 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.