refactor(rmcp-client): simplify oauth refresh coordination

This commit is contained in:
Casey Chow
2026-06-04 21:32:37 +00:00
parent e720de2ba3
commit 20e4e38d52
5 changed files with 165 additions and 246 deletions
@@ -92,17 +92,17 @@ pub(crate) async fn create_client(base_url: &str) -> anyhow::Result<RmcpClient>
}
pub(crate) async fn initialize_client(client: &RmcpClient) -> anyhow::Result<()> {
initialize_client_with_timeout(client, Some(Duration::from_secs(5))).await
initialize_client_with_timeout(client, Duration::from_secs(5)).await
}
pub(crate) async fn initialize_client_with_timeout(
client: &RmcpClient,
timeout: Option<Duration>,
timeout: Duration,
) -> anyhow::Result<()> {
client
.initialize(
init_params(),
timeout,
Some(timeout),
Box::new(|_, _| {
async {
Ok(ElicitationResponse {