Skip to content

Commit

Permalink
Revert code back to v2.5.3
Browse files Browse the repository at this point in the history
Revert "ci: Also add MIRI tests"

This reverts commit 2493d3c.

Revert "ci: Add CI tests for dependent crates"

This reverts commit c56420d.

Revert "v5.3.0"

This reverts commit db5857b.

Revert "feat: Add a loom implementation for event-listener"

This reverts commit f402b7e.

Revert "docs: Make empty listener panic clearer"

This reverts commit 58dbfc8.

Revert "v5.2.0"

This reverts commit 8f11a87.

Revert "feat: Mark StackSlot as Sync"

This reverts commit c9d736a.

Revert "v5.1.0"

This reverts commit 3a49a00.

Revert "StackSlot should be send"

This reverts commit e5464b4.

Revert "v5.0.0"

This reverts commit 4c35680.

Revert "chore: Polish the implementation of the new API"

This reverts commit 6e6202b.

Revert "feat: Move Future impl to forwarding macro"

This reverts commit 6fc00c0.

Revert "ex: Remove unsafe code from mutex example"

This reverts commit e0fefc2.

Revert "feat: Add stack-based listener"

This reverts commit 68be528.

Revert "feat: Create Listener trait"

This reverts commit d9144a8.

Revert "feat: Move EventListener back onto the heap"

This reverts commit 86b7780.

Revert "chore: Fix up some minor bits before release"

This reverts commit ac18bdf.

Revert "feat: Add a way to get the current number of listeners"

This reverts commit a68f5ee.

Revert "Remove RefCell<Option> from PARKER"

This reverts commit 5f5135e.

Revert "Release 4.0.3"

This reverts commit b1d437a.

Revert "Relax MSRV to 1.60"

This reverts commit aade039.

Revert "ci: Use cargo-hack's --rust-version flag for msrv check"

This reverts commit 45272f9.

Revert "Update criterion requirement from 0.4.0 to 0.5.1 (#62)"

This reverts commit 08c7e16.

Revert "v4.0.2"

This reverts commit 9e986e6.

Revert "bugfix: Avoid spinning when waiting for deadline"

This reverts commit e0c8290.

Revert "v4.0.1"

This reverts commit ea0f601.

Revert "bugfix: Remove listener if one already exists"

This reverts commit c2d1ccb.

Revert "Bump MSRV to 1.61 (#102)"

This reverts commit cc33cc5.

Revert "v4.0.0"

This reverts commit 531c106.

Revert "breaking: Fix the EventListener::new() footgun"

This reverts commit 21b34bf.

Revert "v3.1.0"

This reverts commit e6ec597.

Revert "feat: Implement `UnwindSafe` for `EventListener`"

This reverts commit 3f0d516.

Revert "Update futures-lite requirement from 1.12.0 to 2.0.0"

This reverts commit c42dc40.

Revert "v3.0.1"

This reverts commit ca65475.

Revert "m: Update fmt::Debug to produce new info"

This reverts commit 74e8231.

Revert "Fix doctest and nitpick"

This reverts commit 5c11241.

Revert "docs: Document that EventListeners must be listen'd on"

This reverts commit ac3978e.

Revert "Migrate to Rust 2021 (#85)"

This reverts commit ccd2dfe.

Revert "tests: Fix MIRI test errors"

This reverts commit 10bae60.

Revert "v3.0.0"

This reverts commit d2ed2cd.

Revert "Relax memory ordering in AtomicCell::replace (#83)"

This reverts commit 7bbabd0.

Revert "Disable IntoNotification::tag with no_std (#81)"

This reverts commit 450942e.

Revert "Remove extra comma from cfg (#82)"

This reverts commit 4965ddd.

Revert "Update actions/checkout action to v4"

This reverts commit d4c63e9.

Revert "Move event-listener-strategy to its own repository"

This reverts commit cbbe9aa.

Revert "feat: Add explicit web support"

This reverts commit c278371.

Revert "feat: Implement UnwindSafe on core"

This reverts commit 85ca6d3.

Revert "bugfix: Tracking down a deadlock in async-channel"

This reverts commit e408ccd.

Revert "m: Remove tag support from no_std"

This reverts commit 564b84b.

Revert "bugfix: Fix a couple of bugs in the no_std implementation"

This reverts commit 1c95cd2.

Revert "bugfix: Use inline assembly in full_fence"

This reverts commit 7ce2634.

Revert "Update CI config (#72)"

This reverts commit 8c55219.

Revert "m: Remove most of Pin API related unsafe code"

This reverts commit 0ea4641.

Revert "docs: Fix typos"

This reverts commit a1c3570.

Revert "Update minimal version of pin-project-lite to 0.2.12 (#66)"

This reverts commit 779b391.

Revert "feat: Add an is_listening() method to the event listener"

This reverts commit 6b6644a.

Revert "Add smol-rs logo (#63)"

This reverts commit 7c42a41.

Revert "Add a poll_with_strategy method to easy_wrapper! (#60)"

This reverts commit 5180532.

Revert "Make sure Event/EventListener are Send/Sync (#59)"

This reverts commit d6065ed.

Revert "Add documentation of new functionality"

This reverts commit e2e89d2.

Revert "Make the notify() function return notified count"

This reverts commit 6345794.

Revert "Add support for generic types to easy_wrapper (#54)"

This reverts commit fb90f08.

Revert "feat: Add an "is_notified" function (#48)"

This reverts commit 6d2a097.

Revert "Replace boxed closure with a vec of tags"

This reverts commit 9275054.

Revert "Minimize GITHUB_TOKEN permissions"

This reverts commit 97865d1.

Revert "Set CARGO_NET_GIT_FETCH_WITH_CLI=true in CI"

This reverts commit 43950ee.

Revert "Remove the pin-utils dependency (#56)"

This reverts commit 0749ab4.

Revert "Wire up the Strategy trait with the new tags"

This reverts commit a8c3aa7.

Revert "Fix doctests"

This reverts commit a7e74b2.

Revert "Seal the Notification and IntoNotification traits"

This reverts commit 15b4ea2.

Revert "Fix various CI errors"

This reverts commit 723c328.

Revert "Add a type parameter T to Event"

This reverts commit e001c7a.

Revert "Change out SingleNotify for GenericNotify"

This reverts commit 266b60d.

Revert "Adjust the Notification logic slightly"

This reverts commit 5f67dd0.

Revert "Add the Notification trait"

This reverts commit d986a5c.

Revert "Add a portable-atomic feature (#53)"

This reverts commit e909945.

Revert "Review comments"

This reverts commit 72bfe07.

Revert "Forgot to adjust length in remove()"

This reverts commit 8208309.

Revert "Fix code review/CI issues"

This reverts commit 17952d6.

Revert "Avoid allocation in the benchmarks"

This reverts commit bc07d43.

Revert "Build tests for no-default-features into C/I"

This reverts commit 2ac3be0.

Revert "Unsplit the 'Incomplete' commit"

This reverts commit 1ec136a.

Revert "Fix tests"

This reverts commit 3fefa6c.

Revert "Add a libstd implementation of the inner list"

This reverts commit 20c69a1.

Revert "EventListener is now used through pinning"

This reverts commit 996ee4d.

Revert "Use a cached Parker/Unparker pair when possible"

This reverts commit c659cf8.

Revert "Replace Listener with Option<sys::Listener>"

This reverts commit 09ded13.

Revert "Split the EventListener struct into a sub-listener structure"

This reverts commit de1f13a.

Revert "High-level module reorganization"

This reverts commit 0c76968.

Revert "Remove the `crossbeam-utils` dependency"

This reverts commit 5c83b86.

Revert "Remove the `slab` dependency"

This reverts commit 1188962.

Revert "Move node.rs and queue.rs to be submodules of list.rs"

This reverts commit 393566a.

Revert "Move the lock method to list.rs and rename it to try_lock"

This reverts commit 2d171ae.

Revert "Trim unnecessary abstractions"

This reverts commit 1a4df18.

Revert "Move listener data into list.rs"

This reverts commit be047ad.

Revert "Move list guard/inner list to list.rs"

This reverts commit 0ddf3d6.

Revert "Move inner data to lib.rs"

This reverts commit 9e32177.

Revert "fix(el-strategy): missing feature='std' on Ready impl"

This reverts commit 690cae5.

Revert "feat: Add the event-listener-strategy crate (#49)"

This reverts commit 52cb4bf.

Revert "Enable dependabot update for Rust"

This reverts commit 673e1fa.

Revert "Clean up CI config"

This reverts commit 097cbae.

Revert "Remove msrv field from .clippy.toml"

This reverts commit 7beefeb.

Revert "Fix build badge and update links (#45)"

This reverts commit 0ea39a6.

Revert "Replace the linked list with a safer and less allocation-heavy alternative (#38)"

This reverts commit 0235e55.

Revert "Bump criterion to 0.4.0 (#35)"

This reverts commit 6496571.

Revert "Implement an algorithm to make this crate no_std, take 3 (#34)"

This reverts commit 16b3d59.

Revert "Add basic benchmarks (#31)"

This reverts commit 5c1ae63.

Revert "Bump rust-version to 1.39 (#29)"

This reverts commit c36d7d5.

Revert "Use the parking crate instead of threading APIs (#27)"

This reverts commit a01518f.
  • Loading branch information
notgull committed May 4, 2024
1 parent f386699 commit acc3862
Show file tree
Hide file tree
Showing 16 changed files with 778 additions and 4,463 deletions.
1 change: 1 addition & 0 deletions .clippy.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
msrv = "1.36"
9 changes: 0 additions & 9 deletions .github/dependabot.yml

This file was deleted.

147 changes: 28 additions & 119 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,170 +1,79 @@
name: CI

permissions:
contents: read

on:
pull_request:
push:
branches:
- master
schedule:
- cron: '0 2 * * 0'
- cron: '0 2 * * *'

env:
CARGO_INCREMENTAL: 0
CARGO_NET_GIT_FETCH_WITH_CLI: true
CARGO_NET_RETRY: 10
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
RUSTFLAGS: -D warnings
RUSTDOCFLAGS: -D warnings
RUSTUP_MAX_RETRIES: 10

defaults:
run:
shell: bash
RUST_BACKTRACE: 1

jobs:
test:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- rust: stable
- rust: beta
- rust: nightly
- rust: nightly
target: i686-unknown-linux-gnu
os: [ubuntu-latest]
rust: [nightly, beta, stable]
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v3
- name: Install Rust
run: rustup update ${{ matrix.rust }} && rustup default ${{ matrix.rust }}
- name: Install cross-compilation tools
uses: taiki-e/setup-cross-toolchain-action@v1
with:
target: ${{ matrix.target }}
if: matrix.target != ''
- run: cargo build --all --all-features --all-targets
- run: cargo test --all
- run: cargo test --all --release
- run: cargo test --no-default-features --tests
- run: cargo test --no-default-features --tests --release
- name: Install cargo-hack
uses: taiki-e/install-action@cargo-hack
- run: rustup target add thumbv7m-none-eabi
- name: Run cargo check (without dev-dependencies to catch missing feature flags)
run: cargo hack build --all --no-dev-deps
- run: cargo hack build --all --target thumbv7m-none-eabi --no-default-features --no-dev-deps
- run: cargo hack build --target thumbv7m-none-eabi --no-default-features --no-dev-deps --features portable-atomic
- name: Install wasm-pack
uses: taiki-e/install-action@wasm-pack
- run: wasm-pack test --node
- run: wasm-pack test --node --no-default-features
- run: wasm-pack test --node --no-default-features --features portable-atomic
- name: Clone some dependent crates
run: |
git clone https://github.com/smol-rs/event-listener-strategy.git
git clone https://github.com/smol-rs/async-channel.git
git clone https://github.com/smol-rs/async-lock.git
- name: Patch dependent crates
run: |
echo '[patch.crates-io]' >> event-listener-strategy/Cargo.toml
echo 'event-listener = { path = ".." }' >> event-listener-strategy/Cargo.toml
echo '[patch.crates-io]' >> async-channel/Cargo.toml
echo 'event-listener = { path = ".." }' >> async-channel/Cargo.toml
echo 'event-listener-strategy = { path = "../event-listener-strategy" }' >> async-channel/Cargo.toml
echo '[patch.crates-io]' >> async-lock/Cargo.toml
echo 'event-listener = { path = ".." }' >> async-lock/Cargo.toml
echo 'event-listener-strategy = { path = "../event-listener-strategy" }' >> async-lock/Cargo.toml
echo 'async-channel = { path = "../async-channel" }' >> async-lock/Cargo.toml
- name: Test dependent crates
run: |
cargo test --manifest-path=event-listener-strategy/Cargo.toml
cargo test --manifest-path=async-channel/Cargo.toml
cargo test --manifest-path=async-lock/Cargo.toml
if: startsWith(matrix.rust, 'nightly')
run: cargo check -Z features=dev_dep
- run: cargo test

msrv:
runs-on: ubuntu-latest
strategy:
matrix:
# When updating this, the reminder to update the minimum supported
# Rust version in Cargo.toml and .clippy.toml.
rust: ['1.36']
steps:
- uses: actions/checkout@v4
- name: Install cargo-hack
uses: taiki-e/install-action@cargo-hack
- run: cargo hack build --all --rust-version
- run: cargo hack build --all --no-default-features --rust-version
- uses: actions/checkout@v3
- name: Install Rust
run: rustup update ${{ matrix.rust }} && rustup default ${{ matrix.rust }}
- run: cargo build

clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v3
- name: Install Rust
run: rustup update stable
- run: cargo clippy --all --all-features --all-targets
- run: cargo clippy --all-features --all-targets

fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v3
- name: Install Rust
run: rustup update stable
- run: cargo fmt --all --check

miri:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v3
- name: Install Rust
run: rustup toolchain install nightly --component miri && rustup default nightly
- run: |
echo "MIRIFLAGS=-Zmiri-strict-provenance -Zmiri-symbolic-alignment-check -Zmiri-disable-isolation" >>"${GITHUB_ENV}"
echo "RUSTFLAGS=${RUSTFLAGS} -Z randomize-layout" >>"${GITHUB_ENV}"
- run: cargo miri test --all
- run: cargo miri test --no-default-features --tests
- run: cargo miri test --no-default-features --features portable-atomic --tests
- name: Clone some dependent crates
run: |
git clone https://github.com/smol-rs/event-listener-strategy.git
git clone https://github.com/smol-rs/async-channel.git
git clone https://github.com/smol-rs/async-lock.git
- name: Patch dependent crates
run: |
echo '[patch.crates-io]' >> event-listener-strategy/Cargo.toml
echo 'event-listener = { path = ".." }' >> event-listener-strategy/Cargo.toml
echo '[patch.crates-io]' >> async-channel/Cargo.toml
echo 'event-listener = { path = ".." }' >> async-channel/Cargo.toml
echo 'event-listener-strategy = { path = "../event-listener-strategy" }' >> async-channel/Cargo.toml
echo '[patch.crates-io]' >> async-lock/Cargo.toml
echo 'event-listener = { path = ".." }' >> async-lock/Cargo.toml
echo 'event-listener-strategy = { path = "../event-listener-strategy" }' >> async-lock/Cargo.toml
echo 'async-channel = { path = "../async-channel" }' >> async-lock/Cargo.toml
- name: Test dependent crates
# async-channel isn't included here as it appears to be broken on MIRI.
# See https://github.com/smol-rs/async-channel/issues/85
run: |
cargo miri test --manifest-path=event-listener-strategy/Cargo.toml
cargo miri test --manifest-path=async-lock/Cargo.toml
- run: cargo miri test
env:
MIRIFLAGS: -Zmiri-strict-provenance -Zmiri-symbolic-alignment-check -Zmiri-disable-isolation
RUSTFLAGS: ${{ env.RUSTFLAGS }} -Z randomize-layout

security_audit:
permissions:
checks: write
contents: read
issues: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# https://github.com/rustsec/audit-check/issues/2
- uses: rustsec/audit-check@master
- uses: actions/checkout@v3
- uses: actions-rs/audit-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}

loom:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust
run: rustup update stable
- name: Loom tests
run: RUSTFLAGS="--cfg=loom" cargo test --release --test loom --features loom


5 changes: 1 addition & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
name: Release

permissions:
contents: write

on:
push:
tags:
Expand All @@ -13,7 +10,7 @@ jobs:
if: github.repository_owner == 'smol-rs'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v3
- uses: taiki-e/create-gh-release-action@v1
with:
changelog: CHANGELOG.md
Expand Down
61 changes: 0 additions & 61 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,64 +1,3 @@
# Version 5.3.0

- Add a `loom` implementation. This feature is unstable and is not semver-supported. (#126)
- Make the panic message for polling the `EventListener` after it has completed more clear. (#125)

# Version 5.2.0

- Make `StackSlot` `Sync`. (#121)

# Version 5.1.0

- Make `StackSlot` `Send`. (#119)

# Version 5.0.0

- **Breaking:** Rework the API to afford better usage. (#105)
- The heap-based API of the v2.x line is back.
- However, there is a stack-based API as an alternative.
- Add a way to get the total number of listeners. (#114)

# Version 4.0.3

- Relax MSRV to 1.60. (#110)

# Version 4.0.2

- Avoid spinning in `wait_deadline`. (#107)

# Version 4.0.1

- Fix a use-after-move error after an `EventListener` is assigned to listen to
another `Event`. (#101)

# Version 4.0.0

- **Breaking:** Fix a footgun in the `EventListener` type. `EventListener::new()`
now no longer takes an `&Event` as an argument, and `EventListener::listen()`
takes the `&Event` as an argument. Hopefully this should prevent `.await`ing
on a listener without making sure it's listening first. (#94)

# Version 3.1.0

- Implement `UnwindSafe` and `RefUnwindSafe` for `EventListener`. This was unintentionally removed in version 3 (#96).

# Version 3.0.1

- Emphasize that `listen()` must be called on `EventListener` in documentation. (#90)
- Write useful output in `fmt::Debug` implementations. (#86)

# Version 3.0.0

- Use the `parking` crate instead of threading APIs (#27)
- Bump MSRV to 1.59 (#71)
- **Breaking:** Make this crate `no_std`-compatible on `default-features = false`. (#34)
- Create a new `event-listener-strategy` crate for abstracting over blocking/non-blocking operations. (#49)
- **Breaking:** Change the `EventListener` API to be `!Unpin`. (#51)
- Enable a feature for the `portable-atomic` crate. (#53)
- **Breaking:** Add a `Notification` trait which is used to enable tagged events. (#52)
- Add an `is_notified()` method to `Event`. (#48)
- **Breaking:** Make it so `notify()` returns the number of listeners notified. (#57)

# Version 2.5.3

- Fix fence on x86 and miri.
Expand Down
49 changes: 5 additions & 44 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,57 +2,18 @@
name = "event-listener"
# When publishing a new version:
# - Update CHANGELOG.md
# - Create "v5.x.y" git tag
version = "5.3.0"
# - Create "v2.x.y" git tag
version = "2.5.3"
authors = ["Stjepan Glavina <stjepang@gmail.com>"]
edition = "2021"
rust-version = "1.60"
edition = "2018"
rust-version = "1.36"
description = "Notify async tasks or threads"
license = "Apache-2.0 OR MIT"
repository = "https://github.com/smol-rs/event-listener"
keywords = ["condvar", "eventcount", "wake", "blocking", "park"]
categories = ["asynchronous", "concurrency"]
exclude = ["/.*"]

[features]
default = ["std"]
std = ["concurrent-queue/std", "parking"]
portable-atomic = ["portable-atomic-util", "portable_atomic_crate"]
loom = ["concurrent-queue/loom", "parking?/loom", "dep:loom"]

[dependencies]
concurrent-queue = { version = "2.4.0", default-features = false }
pin-project-lite = "0.2.12"
portable-atomic-util = { version = "0.1.4", default-features = false, optional = true, features = ["alloc"] }

[target.'cfg(not(target_family = "wasm"))'.dependencies]
parking = { version = "2.0.0", optional = true }

[target.'cfg(loom)'.dependencies]
loom = { version = "0.7", optional = true }

[dependencies.portable_atomic_crate]
package = "portable-atomic"
version = "1.2.0"
default-features = false
optional = true

[dev-dependencies]
futures-lite = "2.0.0"
try-lock = "0.2.5"
futures = { version = "0.3", default-features = false, features = ["std"] }
waker-fn = "1"

[dev-dependencies.criterion]
version = "0.5"
default-features = false
features = ["cargo_bench_support"]

[target.'cfg(target_family = "wasm")'.dev-dependencies]
wasm-bindgen-test = "0.3"

[[bench]]
name = "bench"
harness = false

[lib]
bench = false
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# event-listener

[![Build](https://github.com/smol-rs/event-listener/workflows/CI/badge.svg)](
[![Build](https://github.com/smol-rs/event-listener/workflows/Build%20and%20test/badge.svg)](
https://github.com/smol-rs/event-listener/actions)
[![License](https://img.shields.io/badge/license-Apache--2.0_OR_MIT-blue.svg)](
https://github.com/smol-rs/event-listener)
Expand All @@ -17,7 +17,7 @@ You can use this crate to turn non-blocking data structures into async or blocki
structures. See a [simple mutex] implementation that exposes an async and a blocking interface
for acquiring locks.

[eventcounts]: https://www.1024cores.net/home/lock-free-algorithms/eventcounts
[eventcounts]: http://www.1024cores.net/home/lock-free-algorithms/eventcounts
[simple mutex]: ./examples/mutex.rs

## Examples
Expand Down Expand Up @@ -74,8 +74,8 @@ loop {

Licensed under either of

* Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or https://www.apache.org/licenses/LICENSE-2.0)
* MIT license ([LICENSE-MIT](LICENSE-MIT) or https://opensource.org/licenses/MIT)
* Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
* MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)

at your option.

Expand Down
Loading

0 comments on commit acc3862

Please sign in to comment.