"Fossies" - the Fresh Open Source Software Archive

Member "ILIAS-5.4.9/Services/BackgroundTask/README.md" (24 Jan 2020, 1358 Bytes) of package /linux/www/ILIAS-5.4.9.tar.gz:

As a special service "Fossies" has tried to format the requested source page into HTML format (assuming markdown format). Alternatively you can here view or download the uninterpreted source code file. A member file download can also be achieved by clicking within a package contents listing on the according byte size field.

Service “BackgroundTask”

In General

Whenever a long-running task has to be processed in ILIAS a background task should be used. This way the user can be informed about the progress and cancel the task at any point in time. The presentation as a modal is done via JavaScript which polls the server for progress updates in certain intervals.


A background task handler implements a specific type of background task, e.g. creating a zip archive. It abstracts the basic steps to process. While it can be a non-abstract implementation it might be beneficial to distinguish between type of background task and specific task, e.g. downloading a folder. The folder download task is responsible for the GUI integration and gathering of files, while the parent zip handler is all about process and progress handling.


The handler inits a task and updates the progress information. This is done by simply calculating the overall steps needed on initialisation and writing the current step to the database whenever possible while processing. The service will update the GUI progress bar accordingly.


The communication between client and server is done via Json. Use ilBackgroundTaskJson to generate valid Json messages which can be parsed by the JavaScript frontend. See ilFolderDownloadBackgroundTaskHandler::init() for examples.