We currently only have the scheduling capability in the storage modules as provided by RMB. There is a need to have a scheduling capability also in the BL modules (e.g mod-circulation, please link the appropriate stories).
Since BL modules have no persistence and may run in multiple instance we need a solution that will ensure the scheduling is coordinated (the scheduled event happens only once).
Also, any scheduled activities needed to be granted permissions to interact with other module endpoints.
One option is to do scheduling in Okapi;
- extend the module descriptor with a a new "handler" type that would also include a property that would indicate to Okapi that the handler should be called periodically (e.g "tick" = minute,quarter,hour) (should this really be part of the tenant API?)
- have Okapi elect a designated scheduling instance that will call the "handler" and ensure the handler is called only once
- have the scheduling Okapi instance call the "handler" with a token that include permission reported though modulePermissions.