Skip to content

Commit

Permalink
Updating to include latest changes to the core schema (#55)
Browse files Browse the repository at this point in the history
* Updating to include latest changes to the core schema

Signed-off-by: Kevin Hoffman <[email protected]>

* Putting codegen back to URL after publishing IDL

Signed-off-by: Kevin Hoffman <[email protected]>
  • Loading branch information
autodidaddict authored Dec 5, 2021
1 parent cda3441 commit 7ac0d60
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 22 deletions.
4 changes: 2 additions & 2 deletions rpc-rs/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "wasmbus-rpc"
version = "0.5.6"
version = "0.6.0"
authors = [ "wasmcloud Team" ]
license = "Apache-2.0"
description = "Runtime library for actors and capability providers"
Expand Down Expand Up @@ -29,7 +29,7 @@ serde = { version = "1.0", features = ["derive"] }
serde_bytes = "0.11"
serde_json = "1.0"
thiserror = "1.0"
minicbor = { version = "0.11", features = ["derive", "std", "half" ] }
minicbor = { version = "0.12", features = ["derive", "std", "half" ] }
toml = "0.5"
log = "0.4"
cfg-if = "1.0"
Expand Down
14 changes: 0 additions & 14 deletions rpc-rs/rustfmt.toml

This file was deleted.

4 changes: 4 additions & 0 deletions rpc-rs/src/wasmbus_core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ pub struct HostData {
pub link_definitions: ActorLinks,
/// list of cluster issuers
pub cluster_issuers: ClusterIssuers,
/// Optional configuration JSON sent to a given link name of a provider
/// without an actor context
#[serde(default, skip_serializing_if = "Option::is_none")]
pub config_json: Option<String>,
}

/// Environment settings for initializing a capability provider
Expand Down
23 changes: 17 additions & 6 deletions rpc-rs/tests/nats_sub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,10 @@ async fn listen_bin(client: RpcClient, subject: &str) -> tokio::task::JoinHandle
}

async fn listen_queue(
client: RpcClient, subject: &str, queue: &str, pattern: &str,
client: RpcClient,
subject: &str,
queue: &str,
pattern: &str,
) -> tokio::task::JoinHandle<u64> {
let subject = subject.to_string();
let queue = queue.to_string();
Expand Down Expand Up @@ -172,11 +175,14 @@ async fn test_message_size() -> Result<(), Box<dyn std::error::Error>> {
Ok(Err(rpc_err)) => {
eprintln!("rpc send error on msg size {}: {}", *size, rpc_err);
continue;
},
}
Err(timeout_err) => {
eprintln!("rpc timeout: sending msg of size {}: {}", *size, timeout_err);
eprintln!(
"rpc timeout: sending msg of size {}: {}",
*size, timeout_err
);
continue;
},
}
};
let sbody = String::from_utf8_lossy(&resp);
let received_size = sbody.parse::<u32>().expect("response contains int size");
Expand All @@ -189,7 +195,11 @@ async fn test_message_size() -> Result<(), Box<dyn std::error::Error>> {
}
assert_eq!(pass_count, TEST_SIZES.len(), "some size tests did not pass");
let val = l1.await.expect("join");
assert_eq!(val as usize, TEST_SIZES.len(), "some messages were not received");
assert_eq!(
val as usize,
TEST_SIZES.len(),
"some messages were not received"
);
Ok(())
}

Expand Down Expand Up @@ -252,7 +262,8 @@ async fn queue_sub() -> Result<(), Box<dyn std::error::Error>> {
const TWO_SEC: Duration = Duration::from_secs(2);

async fn wait_for<O, F: futures::Future<Output = O>>(
f: F, timeout: Duration,
f: F,
timeout: Duration,
) -> Result<O, Box<dyn std::error::Error>> {
let res: O = tokio::time::timeout(timeout, f).await?;
Ok(res)
Expand Down

0 comments on commit 7ac0d60

Please sign in to comment.