Default WorkManager impl use the workId as key in a map to store works, as a results submitting multiple time a work with the same ids don't create duplicate if the works are in pending/running state.
The Stream impl should also prevent multiple execution of works with same ids.
As described in NXP-23374 appling idempotence to workmanager is easy with stream, this will results in the same behavior as the default WorkManager but enhanced so that it works even for completed works.
To do this we just need to keep the last N ids processed in the WorkComputation and skip work with a known id.
- is required by
-
NXP-23374 Allow to prevent a job from being scheduled several times
- Open