Since hook_cronapi() has been removed, it doesn't seem possible to define jobs dynamically.

This is a needed feature -- for example for Advanced Queue to register its queues with UC.

Comments

joachim created an issue.

Berdir’s picture

Jobs are config entities, you can just create them. We actually do that too for queues optionally, see \Drupal\ultimate_cron\CronJobDiscovery::discoverCronJobs(). We could maybe add an event or so, or you could just decorate that service.

joachim’s picture

Advanced Queue queues are plugins, so I think we'd need to sync UC job entities in our plugin manager's discovery.

Berdir’s picture

Standard queues are plugins too. I'm not sure what you are saying/asking exactly? Yes, either you do it while your discovery is running or when ultimate_cron does that by adding a way to allow modules to run some logic too.