Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ restate-cli-util = { workspace = true }
restate-cloud-tunnel-client = { workspace = true }
restate-serde-util = { workspace = true }
restate-time-util = { workspace = true }
restate-futures-util = { workspace = true }
restate-types = { workspace = true }
restate-lite = { workspace = true, optional = true }
mock-service-endpoint = { workspace = true, optional = true }
Expand Down
24 changes: 14 additions & 10 deletions cli/src/clients/admin_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,36 +283,40 @@ impl AdminClient {
}

/// Execute a request and return the response as a lazy Envelope.
pub(crate) async fn run<T>(
pub(crate) fn run<T>(
&self,
method: reqwest::Method,
path: Url,
) -> reqwest::Result<Envelope<T>>
) -> impl Future<Output = reqwest::Result<Envelope<T>>> + 'static
where
T: DeserializeOwned + Send,
{
debug!("Sending request {} ({})", method, path);
let request = self.prepare(method, path.clone());
let resp = request.send().await?;
debug!("Response from {} ({})", path, resp.status());
Ok(resp.into())
async move {
let resp = request.send().await?;
debug!("Response from {} ({})", path, resp.status());
Ok(resp.into())
}
}

pub(crate) async fn run_with_body<T, B>(
pub(crate) fn run_with_body<T, B>(
&self,
method: reqwest::Method,
path: Url,
body: B,
) -> reqwest::Result<Envelope<T>>
) -> impl Future<Output = reqwest::Result<Envelope<T>>> + 'static
where
T: DeserializeOwned + Send,
B: Serialize + std::fmt::Debug + Send,
{
debug!("Sending request {} ({}): {:?}", method, path, body);
let request = self.prepare_with_body(method, path.clone(), body);
let resp = request.send().await?;
debug!("Response from {} ({})", path, resp.status());
Ok(resp.into())
async move {
let resp = request.send().await?;
debug!("Response from {} ({})", path, resp.status());
Ok(resp.into())
}
}
}

Expand Down
Loading
Loading