docs: add example for EsploraClient with timeout configuration#359
docs: add example for EsploraClient with timeout configuration#359Eeshu-Yadav wants to merge 1 commit intobitcoindevkit:masterfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #359 +/- ##
=======================================
Coverage 85.33% 85.33%
=======================================
Files 24 24
Lines 8335 8335
=======================================
Hits 7113 7113
Misses 1222 1222
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
README.md
Outdated
|
|
||
| * [`examples/esplora_async`](https://github.com/bitcoindevkit/bdk_wallet/tree/master/examples/esplora_async) | ||
| * [`examples/esplora_blocking`](https://github.com/bitcoindevkit/bdk_wallet/tree/master/examples/esplora_blocking) | ||
| * [`examples/esplora_with_timeout`](https://github.com/bitcoindevkit/bdk_wallet/tree/master/examples/esplora_with_timeout) - Demonstrates custom timeout and retry configuration |
There was a problem hiding this comment.
I think the comment is unnecessary, and just listing the example should suffice.
a63ddd5 to
f60708b
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds a new example demonstrating how to configure EsploraClient with custom timeout and retry settings for developers working with potentially slow or unreliable network connections.
- Adds
esplora_with_timeout.rsexample showing Builder::timeout() and Builder::max_retries() configuration - Includes comprehensive error handling with helpful tips for timeout failures
- Updates documentation to reference the new example
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| examples/esplora_with_timeout.rs | New example demonstrating EsploraClient configuration with custom timeout (30s) and retry settings (3 retries), including graceful error handling |
| README.md | Adds reference to the new esplora_with_timeout example in the blockchain data sources section |
| Cargo.toml | Registers the new example in the build configuration |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
AmosOO7
left a comment
There was a problem hiding this comment.
Minor cleanup suggestion: the extra newline printed on line 75 can be removed.
Since line 78 can already print \n, it’s sufficient to rely on that for spacing.
This avoids redundant output and keeps the logging logic simpler and more consistent.
examples/esplora_with_timeout.rs
Outdated
| println!(); | ||
|
|
||
| let balance = wallet.balance(); | ||
| println!("Wallet balance after syncing: {}", balance.total()); | ||
| } |
There was a problem hiding this comment.
Suggest removing the extra line of code in line 75 and just use \n on line 78 just like you have done in other lines
1e0c375 to
c00c2af
Compare
c00c2af to
5fd22fd
Compare
Add a new example demonstrating how to configure EsploraClient with custom timeout and retry settings. This is useful for developers working with slow or unreliable network connections. The example shows: - Setting socket timeout using Builder::timeout() - Configuring max retries using Builder::max_retries() - Handling timeout-related errors gracefully Closes bitcoindevkit#260 Signed-off-by: Eeshu-Yadav <eeshuyadav123@gmail.com>
5fd22fd to
ea7396c
Compare
|
@ValuedMammal kindly review |
|
I cannot see why this warrants a whole new example file when you could just add a few lines to the existing one. |
Description
Add a new example demonstrating how to configure EsploraClient with custom timeout and retry settings. This is useful for developers working with slow or unreliable network connections.
The example shows:
Closes #260
Checklists
All Submissions:
just pbefore pushingFeatures: