Skip to content

Commit 7dd0f0f

Browse files
fix(examples): update messaging-nats,custom-template
Signed-off-by: Brooks Townsend <brooksmtownsend@gmail.com>
1 parent 723879e commit 7dd0f0f

File tree

4 files changed

+26
-17
lines changed

4 files changed

+26
-17
lines changed

examples/rust/providers/custom-template/Cargo.toml

+5-5
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ A capability provider template built for implementation of custom capabilities.
1212
status = "actively-developed"
1313

1414
[dependencies]
15-
anyhow = "1.0.82"
16-
serde = { version = "1.0.197", features = ["derive"] }
17-
tokio = { version = "1.37.0", features = ["full"] }
15+
anyhow = "1"
16+
serde = { version = "1", features = ["derive"] }
17+
tokio = { version = "1", features = ["full"] }
1818
tracing = "0.1"
19-
wasmcloud-provider-sdk = { version = "0.11.0", features = ["otel"] }
20-
wit-bindgen-wrpc = "0.7.0"
19+
wasmcloud-provider-sdk = { version = "0.13.0", features = ["otel"] }
20+
wit-bindgen-wrpc = "0.9.0"

examples/rust/providers/custom-template/src/provider.rs

+8-2
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,10 @@ impl CustomTemplateProvider {
6262
// This is a generated function based on the contents in your `wit/world.wit` file.
6363
let connection = wasmcloud_provider_sdk::get_connection();
6464
serve_provider_exports(
65-
&connection.get_wrpc_client(connection.provider_key()),
65+
&connection
66+
.get_wrpc_client(connection.provider_key())
67+
.await
68+
.context("failed to get wrpc client")?,
6669
provider,
6770
shutdown,
6871
bindings::serve,
@@ -122,7 +125,10 @@ impl Handler<Option<Context>> for CustomTemplateProvider {
122125
name: "sup".to_string(),
123126
count: 3,
124127
};
125-
let client = wasmcloud_provider_sdk::get_connection().get_wrpc_client(component_id);
128+
let client = wasmcloud_provider_sdk::get_connection()
129+
.get_wrpc_client(component_id)
130+
.await
131+
.context("failed to get wrpc client")?;
126132
match process_data::process(&client, None, &sample_data).await {
127133
Ok(response) => {
128134
last_response = Some(response);

examples/rust/providers/messaging-nats/Cargo.toml

+9-9
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ A capability provider that satisfies the 'wasmcloud:messaging' interface using N
1212
status = "actively-developed"
1313

1414
[dependencies]
15-
anyhow = "1.0.86"
16-
async-nats = "0.35.1"
17-
bytes = "1.6.0"
18-
futures = "0.3.30"
19-
serde = { version = "1.0.203" , features = ["derive"] }
20-
tokio = { version = "1.37.0", features = [ "full" ] }
21-
tracing = "0.1.40"
22-
wasmcloud-provider-sdk = "0.9.1"
23-
wit-bindgen-wrpc = "0.6.3"
15+
anyhow = "1"
16+
async-nats = "0.36"
17+
bytes = "1"
18+
futures = "0.3"
19+
serde = { version = "1" , features = ["derive"] }
20+
tokio = { version = "1", features = [ "full" ] }
21+
tracing = "0.1"
22+
wasmcloud-provider-sdk = "0.13.0"
23+
wit-bindgen-wrpc = "0.9.0"

examples/rust/providers/messaging-nats/src/nats.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,10 @@ impl NatsMessagingProvider {
6262
.context("failed to run provider")?;
6363
let connection = get_connection();
6464
serve_provider_exports(
65-
&connection.get_wrpc_client(connection.provider_key()),
65+
&connection
66+
.get_wrpc_client(connection.provider_key())
67+
.await
68+
.context("failed to get wrpc client")?,
6669
provider,
6770
shutdown,
6871
bindings::serve,

0 commit comments

Comments
 (0)