kagkarlsson / db-scheduler

Persistent cluster-friendly scheduler for Java
Apache License 2.0
1.23k stars 188 forks source link

Ability to filter tasks picked up by a scheduler instance #442

Open zeeneir opened 10 months ago

zeeneir commented 10 months ago

Hi, this is more of a feature request. I've recently started to use the db-scheduler library in one of my projects and it is working really great! I was wondering if it possible to add the ability to filter tasks retrieved by the scheduler instance for execution based on certain conditions, eg. based on task_name col, or data within task_data col, or a new tag column? This would be really helpful where multiple instances are running against the same db/table, and some instances share same tasks and some that don't.

This could technically be achieved with issue https://github.com/kagkarlsson/db-scheduler/issues/173. However in that case, the consumer app would have to write the logic instead.

Let me know what you think or if you have any questions.

kagkarlsson commented 9 months ago

Currently there are no such plans, and it would complicate the pulling-logic quite a bit. I would recommend splitting the table in two instead, i.e. use two different tables (it is possible to override the table-name in use).