iluwatar / iluwatar/java-design-patterns
Scheduler pattern
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 94.7k
- Forks
- 27.4k
- Avg merge
- 3d 4h
- Merged PRs (30d)
- 10
Description
Description
The Scheduler design pattern is a behavioral pattern used to manage the execution of tasks. This pattern is particularly useful in scenarios where tasks need to be executed at specific intervals or under specific conditions. The Scheduler pattern typically involves a scheduler component that manages task execution, a task component that defines the executable units of work, and a trigger or condition that initiates task execution.
Main elements of the Scheduler pattern:
- Scheduler: Manages the execution of tasks, determining when and how often they should run.
- Task: Represents the work to be performed, encapsulating the logic for execution.
- Trigger/Condition: Specifies the criteria or schedule for task execution, such as time intervals or specific events.
- Execution Context: Provides the environment in which tasks are executed, handling necessary resources and states.
References
Acceptance Criteria
- Implement the Scheduler component to manage and execute tasks based on defined triggers or conditions.
- Define and implement a Task interface that encapsulates the logic for various tasks.
- Create examples demonstrating the usage of the Scheduler pattern with different types of triggers/conditions and tasks.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Project Contribution Guidelines and inspect existing design-pattern examples in the repository to understand its structure and conventions. Then determine the appropriate locations for the Scheduler, Task interface, and usage examples; done means tasks execute according to defined triggers or conditions and examples cover multiple trigger and task types.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 28/100