Skip to content

Commit

Permalink
Merge pull request #681 from drmingdrmer/50-refact
Browse files Browse the repository at this point in the history
Refactor: enable `serde_json` for toy-rpc
  • Loading branch information
drmingdrmer authored Feb 17, 2023
2 parents 9b86ec6 + 0f50ddf commit 1ae5b35
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,7 @@ jobs:
- "nightly"
example:
- "raft-kv-memstore"
# 2023-02-17: this test blocks forever
# - "raft-kv-rocksdb"
- "raft-kv-rocksdb"

steps:
- uses: actions/checkout@v2
Expand Down
4 changes: 2 additions & 2 deletions examples/raft-kv-memstore/tests/cluster/test_cluster.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ async fn test_cluster() -> anyhow::Result<()> {

// --- Wait for a while to let the replication get done.

tokio::time::sleep(Duration::from_millis(200)).await;
tokio::time::sleep(Duration::from_millis(1_000)).await;

// --- Read it on every node.

Expand Down Expand Up @@ -203,7 +203,7 @@ async fn test_cluster() -> anyhow::Result<()> {
})
.await?;

tokio::time::sleep(Duration::from_millis(500)).await;
tokio::time::sleep(Duration::from_millis(1_000)).await;

// --- Read it on every node.

Expand Down
4 changes: 3 additions & 1 deletion examples/raft-kv-rocksdb/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ rocksdb = "0.20.1"
serde = { version = "1.0.114", features = ["derive"] }
serde_json = "1.0.57"
tide = { version = "0.16" }
toy-rpc = { version = "0.8.6", features = [ "ws_async_std", "server", "client", "async_std_runtime", ] }
# for toy-rpc, use `serde_json` instead of the default `serde_bincode`:
# bincode which enabled by default by toy-rpc, does not support `#[serde(flatten)]`: https://docs.rs/bincode/2.0.0-alpha.1/bincode/serde/index.html#known-issues
toy-rpc = { version = "0.8.6", default-features = false, features = [ "serde_json", "ws_async_std", "server", "client", "async_std_runtime", ] }
tracing = "0.1.29"
tracing-futures = "0.2.4"
tracing-subscriber = { version = "0.3.0", features = ["env-filter"] }
Expand Down

0 comments on commit 1ae5b35

Please sign in to comment.