Skip to content

bitreq: use Duration for Request::with_timeout#642

Open
luisschwab wants to merge 1 commit into
rust-bitcoin:masterfrom
luisschwab:bitreq/use-duration-for-timeout
Open

bitreq: use Duration for Request::with_timeout#642
luisschwab wants to merge 1 commit into
rust-bitcoin:masterfrom
luisschwab:bitreq/use-duration-for-timeout

Conversation

@luisschwab

Copy link
Copy Markdown

Closes #641

Uses Duration for Reqwest::with_timeout, since u64 leaves a bit of room for doubt.

@tnull tnull left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Generally makes sense to me.

Comment thread jsonrpc/src/http/bitreq_http.rs Outdated
let secs = self.timeout.as_secs();
if secs == 0 && self.timeout > Duration::from_secs(0) {
1
Duration::from_secs(1)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Codex:

  • [P1] /home/tnull/workspace/corepc-pr-642/jsonrpc/Cargo.toml:41 still allows bitreq = "0.3.5", but jsonrpc now calls the new with_timeout(Duration) API. Published or locked downstream builds can still resolve an older bitreq with with_timeout(u64) and fail to compile when bitreq_http or
    bitreq_http_async is enabled. Bump the dependency to the first bitreq release containing this breaking API, likely alongside a bitreq version bump.

@luisschwab luisschwab Jun 24, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Should we bump bitreq to v0.3.8 (or maybe to v0.4.0, since this is a breaking change, although minimal) in this same PR?

Bumping bitreq to v0.3.7 on jsonrpc would be of no effect, since this change is still unreleased.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Easier to keep track of that way imo, but up to you.

Comment thread jsonrpc/src/http/bitreq_http.rs Outdated
Comment thread bitreq/CHANGELOG.md Outdated
@luisschwab luisschwab force-pushed the bitreq/use-duration-for-timeout branch from dfdaf26 to c5e4d78 Compare June 24, 2026 14:50
satsfy

This comment was marked as outdated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bitreq: use Duration for timeouts

4 participants