[neon] Migration question: Jobs [message #1751071] |
Wed, 04 January 2017 09:52 |
Urs Beeli Messages: 573 Registered: October 2012 Location: Bern, Switzerland |
Senior Member |
|
|
I'm still working on the migration of our extensive business applications.
In our mars code we make liberal use of org.eclipse.core.runtime.jobs.Job, ServerJob, ClientSyncJob and ClientAsyncJob. I have easily migrated the first three of those to use the new Job-API.
However, I am uncertain how I should best replace a ClientAsyncJob.
Based on the Technical Guide (https://eclipsescout.github.io/6.0/technical-guide.html#jobmanager) I would guess that I'd replace the following code:
ClientSyncJob job = new ClientSyncJob("", session, true) {
@Override
protected void runVoid(IProgressMonitor monitor) throws Throwable {
doSomeStuff()
}
};
job.schedule();
with the following new code:
ModelJobs.schedule(new IRunnable() {
@Override
public void run() throws Exception {
doSomeStuff()
}
}, ModelJobs.newInput(ClientRunContexts.copyCurrent())
.withName("Doing something in model thread")).awaitDone();
Is that assumption correct?
[Updated on: Wed, 04 January 2017 12:51] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.02574 seconds