Skip to content

Change active_interval and idle_interval to std::time::Duration#36

Merged
m-szymon merged 1 commit into
scylladb:masterfrom
lukaszg22:duration
Jun 5, 2026
Merged

Change active_interval and idle_interval to std::time::Duration#36
m-szymon merged 1 commit into
scylladb:masterfrom
lukaszg22:duration

Conversation

@lukaszg22

Copy link
Copy Markdown
Contributor

As decided in #33, changed active_interval and idle_interval fields from u64 (milliseconds) to std::time::Duration.
The new way is more idiomatic, user-friendly, and follows the AWS SDK API.

Previously these options accepted milliseconds from user. The new way is more idiomatic, user-friendly, and follows the AWS SDK API.

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 updates the Alternator client configuration API to use std::time::Duration for active_interval and idle_interval (instead of u64 milliseconds), aligning the public API with more idiomatic Rust and AWS SDK patterns.

Changes:

  • Replaced active_interval / idle_interval config fields and builder setters from Option<u64> to Option<std::time::Duration>.
  • Updated LiveNodes refresh default constants from millisecond integers to Duration constants and removed Duration::from_millis(...) conversions.
  • Refreshed related doc comments to remove millisecond-specific wording and describe defaults in human terms.

Reviewed changes

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

File Description
src/live_nodes.rs Switches refresh interval defaults and wiring to Duration directly.
src/config.rs Updates the public config/builder API and stored extension fields to Duration.

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

@m-szymon m-szymon merged commit 611b3a5 into scylladb:master Jun 5, 2026
2 checks passed
@lukaszg22 lukaszg22 deleted the duration branch June 5, 2026 13:37
lukaszg22 added a commit to lukaszg22/alternator-rust-driver that referenced this pull request Jun 5, 2026
Change milliseconds to std::time::Duration, following the change made in scylladb#36.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants