datashare
datashare copied to clipboard
chore: extract async task lib
TODO
- [ ] handle redisson version properly (try to remove the explicit version in
datashare-app
) - [ ] CI for
datashare-tasks
- [ ] JAR publication for
datashare-tasks
- [ ] validate naming (
datashare-tasks
vs.datashare-async-tasks
) - [ ] review TODOs left in the code
PR description
This PRs extracts the asynchronous tasks logic of DS in its own package. The goal of the operation is that the package can be used by other repos than DS if they want to implement async tasks (neo4j proeject for instance).
Changes
datashare-app
Removed
- removed async tasks logic and added a dependency on
datashare-tasks
datashare-tasks
Added
- created the
datashare-tasks
repo
Changed
- replaced
CancellableCallable
byCancellableTask
- renamed
CanceledEvent
intoCancelledEvent
- task function now take a progress which is only called with the
Double progress
argument. TheString taskId
part of the progress is forwarded inside theTaskRunnerLoop
. This avoid the task implementer to possibly callprogress(taskId, progress)
with the wrongtaskId
.
Left for later
- wrap task cancellation logic in its own function and keep track of the original exception is something goes wrong while handling task error
- align Java and Python
- decouple task name and object name as the current task mapping relies as the current task name mapping heavily relies on class naming and will prevent refactor/renaming/moving classes