Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
- unix: "--features unix"
serde-transport: ""
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@stable
- run: >
cargo test --manifest-path tarpc/Cargo.toml
Expand All @@ -56,7 +56,7 @@ jobs:
outputs:
examples: ${{ steps.matrix.outputs.examples }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@stable
- id: matrix
run: |
Expand All @@ -79,7 +79,7 @@ jobs:
matrix:
example: ${{ fromJSON(needs.list-examples.outputs.examples) }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@stable
- run: |
cargo run --example "${{ matrix.example }}"
Expand All @@ -88,7 +88,7 @@ jobs:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
Expand All @@ -98,7 +98,7 @@ jobs:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr_review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ jobs:
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
Expand Down
14 changes: 7 additions & 7 deletions example-service/Cargo.toml
Comment thread
tikue marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ description = "An example server built on tarpc."

[dependencies]
anyhow = "1.0"
clap = { version = "4.4.18", features = ["derive"] }
clap = { version = "4.5.53", features = ["derive"] }
log = "0.4"
futures = "0.3"
opentelemetry = { version = "0.30.0" }
opentelemetry-otlp = { version = "0.30.0", features = ["grpc-tonic"] }
rand = "0.8"
opentelemetry = { version = "0.31.0" }
opentelemetry-otlp = { version = "0.31.0", features = ["grpc-tonic"] }
rand = "0.9"
tarpc = { version = "0.37", path = "../tarpc", features = ["full"] }
tokio = { version = "1", features = ["macros", "net", "rt-multi-thread"] }
tracing = { version = "0.1" }
tracing-opentelemetry = "0.31.0"
tracing-opentelemetry = "0.32.0"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
opentelemetry_sdk = { version = "0.30.0", features = ["rt-tokio"] }
opentelemetry-semantic-conventions = "0.30.0"
opentelemetry_sdk = { version = "0.31.0", features = ["rt-tokio"] }
opentelemetry-semantic-conventions = "0.31.0"

[lib]
name = "service"
Expand Down
6 changes: 3 additions & 3 deletions example-service/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
use clap::Parser;
use futures::{future, prelude::*};
use rand::{
distributions::{Distribution, Uniform},
thread_rng,
distr::{Distribution, Uniform},
rng,
};
use service::{World, init_tracing};
use std::{
Expand Down Expand Up @@ -37,7 +37,7 @@ struct HelloServer(SocketAddr);
impl World for HelloServer {
async fn hello(self, _: context::Context, name: String) -> String {
let sleep_time =
Duration::from_millis(Uniform::new_inclusive(1, 10).sample(&mut thread_rng()));
Duration::from_millis(Uniform::new_inclusive(1, 10).unwrap().sample(&mut rng()));
Comment thread
tikue marked this conversation as resolved.
time::sleep(sleep_time).await;
format!("Hello, {name}! You are connected from {}", self.0)
}
Expand Down
28 changes: 14 additions & 14 deletions tarpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,42 +44,42 @@ travis-ci = { repository = "google/tarpc" }
anyhow = "1.0"
fnv = "1.0"
futures = "0.3"
humantime = "2.0"
pin-project = "1.0"
rand = "0.8"
humantime = "2.3"
pin-project = "1.1"
rand = "0.9"
serde = { optional = true, version = "1.0", features = ["derive"] }
static_assertions = "1.1.0"
tarpc-plugins = { path = "../plugins", version = "0.14" }
thiserror = "2.0"
tokio = { version = "1", features = ["time"] }
tokio-util = { version = "0.7.3", features = ["time"] }
tokio-util = { version = "0.7.17", features = ["time"] }
tokio-serde = { optional = true, version = "0.9" }
tracing = { version = "0.1", default-features = false, features = [
"attributes",
"log",
] }
tracing-opentelemetry = { version = "0.31.0", default-features = false }
opentelemetry = { version = "0.30.0", default-features = false }
opentelemetry-semantic-conventions = "0.30.0"
tracing-opentelemetry = { version = "0.32.0", default-features = false }
opentelemetry = { version = "0.31.0", default-features = false }
opentelemetry-semantic-conventions = "0.31.0"

[dev-dependencies]
assert_matches = "1.4"
assert_matches = "1.5"
bincode = { version = "2.0", features = ["serde"] }
bytes = { version = "1", features = ["serde"] }
flate2 = "1.0"
flate2 = "1.1"
futures-test = "0.3"
opentelemetry = { version = "0.30.0", default-features = false }
opentelemetry-otlp = { version = "0.30.0", features = ["grpc-tonic"] }
opentelemetry_sdk = { version = "0.30.0", features = ["rt-tokio"] }
opentelemetry = { version = "0.31.0", default-features = false }
opentelemetry-otlp = { version = "0.31.0", features = ["grpc-tonic"] }
opentelemetry_sdk = { version = "0.31.0", features = ["rt-tokio"] }
pin-utils = "0.1.0"
serde_bytes = "0.11"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
tokio = { version = "1", features = ["full", "test-util", "tracing"] }
console-subscriber = "0.4"
console-subscriber = "0.5"
tokio-serde = { version = "0.9", features = ["json", "bincode"] }
trybuild = "1.0"
tokio-rustls = "0.26"
rustls-pemfile = "2.0"
rustls-pemfile = "2.2"

[package.metadata.docs.rs]
all-features = true
Expand Down
2 changes: 1 addition & 1 deletion tarpc/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ pub(crate) trait SpanExt {

impl SpanExt for tracing::Span {
fn set_context(&self, context: &Context) {
self.set_parent(
let _ = self.set_parent(
Comment thread
tikue marked this conversation as resolved.
opentelemetry::Context::new()
.with_remote_span_context(opentelemetry::trace::SpanContext::new(
opentelemetry::trace::TraceId::from(context.trace_context.trace_id),
Expand Down
6 changes: 3 additions & 3 deletions tarpc/src/trace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ impl Context {
pub(crate) fn new_child(&self) -> Self {
Self {
trace_id: self.trace_id,
span_id: SpanId::random(&mut rand::thread_rng()),
span_id: SpanId::random(&mut rand::rng()),
sampling_decision: self.sampling_decision,
}
}
Expand All @@ -91,7 +91,7 @@ impl TraceId {
/// Returns a random trace ID that can be assumed to be globally unique if `rng` generates
/// actually-random numbers.
pub fn random<R: Rng>(rng: &mut R) -> Self {
TraceId(rng.r#gen::<NonZeroU128>().get())
TraceId(rng.random::<NonZeroU128>().get())
Comment thread
tikue marked this conversation as resolved.
}

/// Returns true iff the trace ID is 0.
Expand All @@ -103,7 +103,7 @@ impl TraceId {
impl SpanId {
/// Returns a random span ID that can be assumed to be unique within a single trace.
pub fn random<R: Rng>(rng: &mut R) -> Self {
SpanId(rng.r#gen::<NonZeroU64>().get())
SpanId(rng.random::<NonZeroU64>().get())
}

/// Returns true iff the span ID is 0.
Expand Down