Skip to content

Commit

Permalink
0.3.0 (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
al8n authored Dec 22, 2024
1 parent a11ad62 commit af8bd85
Show file tree
Hide file tree
Showing 60 changed files with 375 additions and 219 deletions.
13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: 2
updates:
- package-ecosystem: "cargo"
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 50

- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every weekday
interval: "daily"
6 changes: 3 additions & 3 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ jobs:
features: "test,tokio,s2n,compression,metrics"
name: "quic-s2n"
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install latest nightly
uses: actions-rs/toolchain@v1
with:
Expand All @@ -129,15 +129,15 @@ jobs:
needs: coverage-report
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Download all coverage reports
uses: actions/download-artifact@v3
with:
path: reports/
- name: List contents of the reports directory
run: ls -a reports
- name: Upload to codecov.io
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
with:
directory: reports
fail_ci_if_error: false
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/net.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,12 @@ jobs:
# - windows-latest
runtime: [tokio, async-std, smol]
stream_layer: [tls, native-tls, tcp]
# TODO: remove this exlucde when figuring out why native-tls with smol leads to a user_data* unit tests failure
exclude:
- runtime: smol
stream_layer: native-tls
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install Rust
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/quinn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
# - windows-latest
runtime: [tokio, async-std, smol]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install Rust
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/s2n.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
# - macos-latest,
# - windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install Rust
run: |
Expand Down
34 changes: 21 additions & 13 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ license = "MPL-2.0"
repository = "https://github.com/al8n/memberlist"
homepage = "https://github.com/al8n/memberlist"
readme = "README.md"
rust-version = "1.75.0"
rust-version = "1.81.0"
keywords = ["swim", "gossip", "service-discovery"]
categories = ["network-programming", "asynchronous"]

Expand All @@ -29,36 +29,44 @@ rustdoc-args = ["--cfg", "docsrs"]
auto_impl = "1"
atomic_refcell = "0.1"
agnostic-lite = { version = "0.3", features = ["time"] }
agnostic = "0.3.5"
agnostic = "0.4"
# agnostic-lite = { version = "0.3", features = ["time"], path = "../agnostic/lite" }
# agnostic = { version = "0.4", path = "../agnostic/agnostic" }
async-lock = "3"
async-channel = "2"
bytes = "1.5"
bytes = "1"
byteorder = "1"
derive_more = "0.99"
derive_more = { version = "1", features = ["full"] }
futures = "0.3"
indexmap = "2"
local-ip-address = "0.6"
metrics = "0.22"
nodecraft = { version = "0.3", features = [
nodecraft = { version = "0.4", features = [
"transformable",
"async",
"resolver",
"agnostic",
] }
# nodecraft = { version = "0.4", path = "../nodecraft", features = [
# "transformable",
# "async",
# "resolver",
# "agnostic",
# ] }
paste = "1"
pin-project = "1"
scopeguard = "1"
serde = { version = "1", features = ["derive", "rc"] }
humantime-serde = "1"
smallvec = "1"
smallvec-wrapper = { version = "0.1", features = ["const_new", "either"] }
smol_str = "0.2"
transformable = { version = "0.1.6", features = ["smol_str", "bytes"] }
thiserror = "1"
smallvec-wrapper = { version = "0.2", features = ["const_new", "either"] }
smol_str = "0.3"
transformable = { version = "0.2", features = ["smol_str03", "bytes1"] }
thiserror = "2"
tracing = "0.1"
viewit = "0.1.5"

memberlist-core = { version = "0.2", path = "core", default-features = false }
memberlist-net = { version = "0.2", path = "transports/net", default-features = false }
memberlist-types = { version = "0.2", path = "types", default-features = false }
memberlist-quic = { version = "0.2", path = "transports/quic", default-features = false }
memberlist-core = { version = "0.3", path = "core", default-features = false }
memberlist-net = { version = "0.3", path = "transports/net", default-features = false }
memberlist-types = { version = "0.3", path = "types", default-features = false }
memberlist-quic = { version = "0.3", path = "transports/quic", default-features = false }
2 changes: 1 addition & 1 deletion README-zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ For details on all of these extensions, please read Hashicorp's paper ["Lifeguar

```toml
[dependencies]
memberlist = "0.1"
memberlist = "0.3"
```

## Q & A
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ For details on all of these extensions, please read Hashicorp's paper ["Lifeguar

```toml
[dependencies]
memberlist = "0.1"
memberlist = "0.3"
```

## Q & A
Expand Down
4 changes: 2 additions & 2 deletions core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "memberlist-core"
version = "0.2.1"
version = "0.3.0"
edition.workspace = true
license.workspace = true
repository.workspace = true
Expand Down Expand Up @@ -56,7 +56,7 @@ derive_more.workspace = true
either = "1"
futures.workspace = true
nodecraft.workspace = true
transformable = { workspace = true, features = ["bytes", "smol_str"] }
transformable = { workspace = true, features = ["bytes1", "smol_str03"] }
paste.workspace = true
parking_lot = "0.12"
pin-project.workspace = true
Expand Down
8 changes: 4 additions & 4 deletions core/src/base/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ impl<I, A> CustomMergeDelegate<I, A> {

impl<I, A> MergeDelegate for CustomMergeDelegate<I, A>
where
I: Id,
I: Id + Send + Sync + 'static,
A: CheapClone + Send + Sync + 'static,
{
type Id = I;
Expand Down Expand Up @@ -424,7 +424,7 @@ impl<I, A> CustomAliveDelegate<I, A> {

impl<I, A> AliveDelegate for CustomAliveDelegate<I, A>
where
I: Id,
I: Id + Send + Sync + 'static,
A: CheapClone + Send + Sync + 'static,
{
type Id = I;
Expand Down Expand Up @@ -957,7 +957,7 @@ impl<I, A> CustomConflictDelegate<I, A> {

impl<I, A> ConflictDelegate for CustomConflictDelegate<I, A>
where
I: Id,
I: Id + Send + Sync + 'static,
A: CheapClone + Send + Sync + 'static,
{
type Id = I;
Expand Down Expand Up @@ -1038,7 +1038,7 @@ impl<I, A> CustomPingDelegate<I, A> {

impl<I, A> PingDelegate for CustomPingDelegate<I, A>
where
I: Id,
I: Id + Send + Sync + 'static,
A: CheapClone + Send + Sync + 'static,
{
type Id = I;
Expand Down
42 changes: 35 additions & 7 deletions core/src/delegate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,11 @@ impl<I, A> VoidDelegate<I, A> {
}
}

impl<I: Id, A: CheapClone + Send + Sync + 'static> AliveDelegate for VoidDelegate<I, A> {
impl<I, A> AliveDelegate for VoidDelegate<I, A>
where
I: Id + Send + Sync + 'static,
A: CheapClone + Send + Sync + 'static,
{
type Error = VoidDelegateError;
type Id = I;
type Address = A;
Expand All @@ -134,7 +138,11 @@ impl<I: Id, A: CheapClone + Send + Sync + 'static> AliveDelegate for VoidDelegat
}
}

impl<I: Id, A: CheapClone + Send + Sync + 'static> MergeDelegate for VoidDelegate<I, A> {
impl<I, A> MergeDelegate for VoidDelegate<I, A>
where
I: Id + Send + Sync + 'static,
A: CheapClone + Send + Sync + 'static,
{
type Error = VoidDelegateError;
type Id = I;
type Address = A;
Expand All @@ -147,7 +155,11 @@ impl<I: Id, A: CheapClone + Send + Sync + 'static> MergeDelegate for VoidDelegat
}
}

impl<I: Id, A: CheapClone + Send + Sync + 'static> ConflictDelegate for VoidDelegate<I, A> {
impl<I, A> ConflictDelegate for VoidDelegate<I, A>
where
I: Id + Send + Sync + 'static,
A: CheapClone + Send + Sync + 'static,
{
type Id = I;
type Address = A;

Expand All @@ -159,7 +171,11 @@ impl<I: Id, A: CheapClone + Send + Sync + 'static> ConflictDelegate for VoidDele
}
}

impl<I: Id, A: CheapClone + Send + Sync + 'static> PingDelegate for VoidDelegate<I, A> {
impl<I, A> PingDelegate for VoidDelegate<I, A>
where
I: Id + Send + Sync + 'static,
A: CheapClone + Send + Sync + 'static,
{
type Id = I;
type Address = A;

Expand All @@ -180,7 +196,11 @@ impl<I: Id, A: CheapClone + Send + Sync + 'static> PingDelegate for VoidDelegate
}
}

impl<I: Id, A: CheapClone + Send + Sync + 'static> EventDelegate for VoidDelegate<I, A> {
impl<I, A> EventDelegate for VoidDelegate<I, A>
where
I: Id + Send + Sync + 'static,
A: CheapClone + Send + Sync + 'static,
{
type Id = I;
type Address = A;

Expand All @@ -191,7 +211,11 @@ impl<I: Id, A: CheapClone + Send + Sync + 'static> EventDelegate for VoidDelegat
async fn notify_update(&self, _node: Arc<NodeState<Self::Id, Self::Address>>) {}
}

impl<I: Id, A: CheapClone + Send + Sync + 'static> NodeDelegate for VoidDelegate<I, A> {
impl<I, A> NodeDelegate for VoidDelegate<I, A>
where
I: Id + Send + Sync + 'static,
A: CheapClone + Send + Sync + 'static,
{
async fn node_meta(&self, _limit: usize) -> Meta {
Meta::empty()
}
Expand All @@ -217,7 +241,11 @@ impl<I: Id, A: CheapClone + Send + Sync + 'static> NodeDelegate for VoidDelegate
async fn merge_remote_state(&self, _buf: Bytes, _join: bool) {}
}

impl<I: Id, A: CheapClone + Send + Sync + 'static> Delegate for VoidDelegate<I, A> {
impl<I, A> Delegate for VoidDelegate<I, A>
where
I: Id + Send + Sync + 'static,
A: CheapClone + Send + Sync + 'static,
{
type Id = I;
type Address = A;
}
14 changes: 7 additions & 7 deletions core/src/delegate/composite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ impl<I, Address, A, C, E, M, N, P> CompositeDelegate<I, Address, A, C, E, M, N,

impl<I, Address, A, C, E, M, N, P> AliveDelegate for CompositeDelegate<I, Address, A, C, E, M, N, P>
where
I: Id,
I: Id + Send + Sync + 'static,
Address: CheapClone + Send + Sync + 'static,
A: AliveDelegate<Id = I, Address = Address>,
C: ConflictDelegate<Id = I, Address = Address>,
Expand All @@ -204,7 +204,7 @@ where

impl<I, Address, A, C, E, M, N, P> MergeDelegate for CompositeDelegate<I, Address, A, C, E, M, N, P>
where
I: Id,
I: Id + Send + Sync + 'static,
Address: CheapClone + Send + Sync + 'static,
A: AliveDelegate<Id = I, Address = Address>,
C: ConflictDelegate<Id = I, Address = Address>,
Expand All @@ -228,7 +228,7 @@ where
impl<I, Address, A, C, E, M, N, P> ConflictDelegate
for CompositeDelegate<I, Address, A, C, E, M, N, P>
where
I: Id,
I: Id + Send + Sync + 'static,
Address: CheapClone + Send + Sync + 'static,
A: AliveDelegate<Id = I, Address = Address>,
C: ConflictDelegate<Id = I, Address = Address>,
Expand All @@ -254,7 +254,7 @@ where

impl<I, Address, A, C, E, M, N, P> PingDelegate for CompositeDelegate<I, Address, A, C, E, M, N, P>
where
I: Id,
I: Id + Send + Sync + 'static,
Address: CheapClone + Send + Sync + 'static,
A: AliveDelegate<Id = I, Address = Address>,
C: ConflictDelegate<Id = I, Address = Address>,
Expand Down Expand Up @@ -289,7 +289,7 @@ where

impl<I, Address, A, C, E, M, N, P> EventDelegate for CompositeDelegate<I, Address, A, C, E, M, N, P>
where
I: Id,
I: Id + Send + Sync + 'static,
Address: CheapClone + Send + Sync + 'static,
A: AliveDelegate<Id = I, Address = Address>,
C: ConflictDelegate<Id = I, Address = Address>,
Expand Down Expand Up @@ -317,7 +317,7 @@ where

impl<I, Address, A, C, E, M, N, P> NodeDelegate for CompositeDelegate<I, Address, A, C, E, M, N, P>
where
I: Id,
I: Id + Send + Sync + 'static,
Address: CheapClone + Send + Sync + 'static,
A: AliveDelegate<Id = I, Address = Address>,
C: ConflictDelegate<Id = I, Address = Address>,
Expand Down Expand Up @@ -360,7 +360,7 @@ where

impl<I, Address, A, C, E, M, N, P> Delegate for CompositeDelegate<I, Address, A, C, E, M, N, P>
where
I: Id,
I: Id + Send + Sync + 'static,
Address: CheapClone + Send + Sync + 'static,
A: AliveDelegate<Id = I, Address = Address>,
C: ConflictDelegate<Id = I, Address = Address>,
Expand Down
2 changes: 1 addition & 1 deletion core/src/delegate/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ impl<I, A> SubscribleEventDelegate<I, A> {

impl<I, A> EventDelegate for SubscribleEventDelegate<I, A>
where
I: Id,
I: Id + Send + Sync + 'static,
A: CheapClone + Send + Sync + 'static,
{
type Id = I;
Expand Down
3 changes: 2 additions & 1 deletion core/src/delegate/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,9 @@ impl<I, A> MockDelegate<I, A> {
}
}

impl<I: Id, A> NodeDelegate for MockDelegate<I, A>
impl<I, A> NodeDelegate for MockDelegate<I, A>
where
I: Send + Sync + 'static,
A: CheapClone + Send + Sync + 'static,
{
async fn node_meta(&self, _limit: usize) -> Meta {
Expand Down
Loading

0 comments on commit af8bd85

Please sign in to comment.