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?;

  // ...
}
```
This commit is contained in:
2023-02-19 21:37:54 +01:00
committed by Kasper Juul Hermansen
parent c35c104b49
commit 9be6f435d9
12 changed files with 778 additions and 395 deletions

View File

@@ -1,7 +1,7 @@
use dagger_sdk::{connect, ContainerExecOptsBuilder};
#[test]
fn test_example_container() {
#[tokio::test]
async fn test_example_container() {
let client = connect().unwrap();
let alpine = client.container().from("alpine:3.16.2");
@@ -14,6 +14,7 @@ fn test_example_container() {
.unwrap(),
)
.stdout()
.await
.unwrap();
assert_eq!(out, "3.16.2\n".to_string())