awslabs / awslabs/aws-sdk-rust
Timestream's `ReloadEndpoint` is unclear
- Dominant language
- Rust
- Stars
- 3.3k
- Forks
- 290
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 3
Description
### Describe the issue
I've made good attempts to understand how Timestream's ReloadEndpoint works, which doesn't seem to documented well. It still doesn't make sense to me, unfortunately.
The docs.rs of [`ReloadEndpoint`](https://docs.rs/aws-sdk-timestreamwrite/latest/aws_sdk_timestreamwrite/endpoint_discovery/struct.ReloadEndpoint.html) only says "Endpoint reloader."
Here's roughly our code:
```rust
let config = aws_config::defaults(aws_config::BehaviorVersion::latest())
.region(REGION)
.load()
.await;
let (client, reload) = aws_sdk_timestreamwrite::Client::new(&config)
.with_endpoint_discovery_enabled()
.await
.unwrap();
// This task will terminate when the corresponding Client is dropped.
tokio::task::spawn(reload.reload_task());
... work with the client here.
```
My questions are:
- What function does the `ReloadEndpoint` have?
- Why do we need to call `.with_endpoint_discovery_enabled()`? It will not work without this.
- It seems to work without me spawning the reload task - What does that task really do then?
### Links
https://github.com/awslabs/aws-sdk-rust/blob/29883b151225f7b27a22e4d343585d2dc8207521/sdk/timestreamwrite/src/client.rs#L18-L23
Contributor guide
Research direction
Start with sdk/timestreamwrite/src/client.rs at the linked endpoint-discovery code, then compare it with the docs.rs ReloadEndpoint documentation. Trace how with_endpoint_discovery_enabled and reload_task are used, and document the reloader's purpose, why opt-in is required, and what spawning the task does. Done means the three questions are answered clearly for users.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100