- User should be able to schedule ad-hoc events
- User should be able to schedule a recurring event with fixed rate
- User should be able to schedule a recurring event with some delay rate
Extended Requirements
- start time, end time for job scheduler
- Async
- Concurrent
- Multithreading
I will be using Java as a preferred language
- ScheduledTask - What I want to actually run
- TaskCreatorService -> factory class to create ScheduledTask.
- SchedulerExecutor - this is where i'll trigger all APIs
- SchedulerService - Can I delegate the actual business logic here
- TaskType - {RUN_ONCE, RECUR, RECUR_WITH_WAIT}
- Queue - PriorityQueue -> push the job and poll from it
- Singleton - SchedulerService
- PriorityQueue
- Executors
- Concurrency
- Synchronization
- Locks
- Conditions (ThreadPoolExecutor)
- Deadlock ?
- How to track error i. while scheduling not much to fail ii. While execution, yes it can -- logging and monitoring