dagger-rs/crates/dagger-sdk/examples/first-pipeline/main.rs
kjuulh 9be6f435d9 feat(sdk,core): Use async runtime instead of blocking.
Default to using async runtime instead of blocking. I.e.

```rust
fn main() -> eyre::Result<()> {
  // ...

  client.container().from("rust").publish("somewhere")?;

  // ...
}

// to

async fn main() -> eyre::Result<()> {
  // ...

  client.container().from("rust").publish("somewhere").await?;

  // ...
}
```
2023-02-19 21:47:40 +01:00

15 lines
311 B
Rust

#[tokio::main]
async fn main() -> eyre::Result<()> {
let client = dagger_sdk::connect()?;
let version = client
.container()
.from("golang:1.19")
.with_exec(vec!["go", "version"])
.stdout().await?;
println!("Hello from Dagger and {}", version.trim());
Ok(())
}