Skip to content

feat: add intervals - #21

Merged
SeaRoll merged 1 commit into
masterfrom
feat-intervals
Jan 24, 2026
Merged

feat: add intervals#21
SeaRoll merged 1 commit into
masterfrom
feat-intervals

Conversation

@SeaRoll

@SeaRoll SeaRoll commented Jan 24, 2026

Copy link
Copy Markdown
Owner

No description provided.

@SeaRoll
SeaRoll requested a review from Copilot January 24, 2026 22:45
@SeaRoll SeaRoll linked an issue Jan 24, 2026 that may be closed by this pull request
@SeaRoll SeaRoll added the enhancement New feature or request label Jan 24, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds interval functionality to support periodic task execution. The implementation follows a burst strategy where the first tick completes immediately, similar to Tokio's interval behavior.

Changes:

  • Added new interval module with Interval and IntervalTick types for periodic task scheduling
  • Updated tests to use assert! instead of expect/unwrap for better test consistency
  • Added example and test demonstrating interval usage with sleep interleaving

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/lib.rs Exported new interval module and refactored test assertions to use assert! pattern
src/interval.rs Implemented Interval struct with tick(), reset() methods and Future-based timing logic
examples/interval.rs Added example demonstrating interval usage with 500ms periods and interleaved sleep

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/interval.rs
Comment thread examples/interval.rs
@SeaRoll
SeaRoll merged commit 9fcea70 into master Jan 24, 2026
4 checks passed
@SeaRoll
SeaRoll deleted the feat-intervals branch January 24, 2026 22:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add interval

2 participants