|
Re: Send notificatiom after job is completed [message #1830458 is a reply to message #1830373] |
Mon, 27 July 2020 06:21 |
|
This is the usual pattern for the client side:
Jobs.schedule(() -> {
try {
// <<< async task (e.g. server call)
}
finally {
ModelJobs.schedule(() -> { // will not run when async job was cancelled
// <<< show notification
}, ModelJobs.newInput(ClientRunContexts.copyCurrent()));
}
}, Jobs.newInput()
.withRunContext(ClientRunContexts.copyCurrent()));
Alternatively, Jobs.schedule() returns an IFuture, which offers a whenDone() callback. Make sure to wrap any modifications to the client model at the end of the async task with ModelJobs.schedule(...).
You'll find detailed information about jobs in the documentation.
Regards,
Beat
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03590 seconds