Skip to content

Commit

Permalink
[rust] implement pushconsumer (#767)
Browse files Browse the repository at this point in the history
* [WIP] push consumer

* add push consumer

* use enum BackOffRetryPolicy

* refactor to optimize struct of Client

* add testcases

* implement standard push consumer

* fix typo

* format code

* add license

* remove extra clones

* flush queues when shutting down actors

* use TryFrom trait to parse retry policy

* optimize message parsing error

* return option instead of result

* fix code style

* remove lifetime

* save time on repeating Box

* chore: update README doc, reflecting we are supporting push-consumer in Rust

Signed-off-by: Zhanhui Li <[email protected]>

* refactor pushconsumer

* fix typo

* fix format

* use correct tokio_util version

* log error on process assignments

* fix tokio-util version

* implement Debug trait for AckEntryItem

* increase converage rate

* optimize code structure

* chore: test macos on macos-12

Signed-off-by: Zhanhui Li <[email protected]>

* fix: upgrade MSRV to 1.70 as dependent crate home requires it

Signed-off-by: Zhanhui Li <[email protected]>

* fix: remove Cargo.lock.min

Signed-off-by: Zhanhui Li <[email protected]>

* fix: fix MSRV check

Signed-off-by: Zhanhui Li <[email protected]>

* fix: specify working-directory

Signed-off-by: Zhanhui Li <[email protected]>

* chore: make cargo-clippy pass

Signed-off-by: Zhanhui Li <[email protected]>

---------

Signed-off-by: Zhanhui Li <[email protected]>
Co-authored-by: Zhanhui Li <[email protected]>
  • Loading branch information
glcrazier and lizhanhui authored Aug 8, 2024
1 parent bd2588a commit 18577c2
Show file tree
Hide file tree
Showing 18 changed files with 3,132 additions and 2,808 deletions.
38 changes: 22 additions & 16 deletions .github/workflows/rust_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ on:
workflow_call:
jobs:
fmt:
name: code style check
runs-on: ubuntu-latest
name: code style check
defaults:
run:
working-directory: ./rust
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -15,11 +18,13 @@ jobs:
toolchain: stable
components: rustfmt
- name: Code format check
working-directory: ./rust
run: cargo fmt --check
clippy:
name: clippy
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./rust
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -31,11 +36,13 @@ jobs:
components: clippy
# Run clippy
- name: clippy check
working-directory: ./rust
run: cargo clippy --all-features -- -D warnings
doc:
name: doc check
runs-on: ubuntu-latest
name: doc check
defaults:
run:
working-directory: ./rust
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -45,27 +52,26 @@ jobs:
with:
toolchain: stable
- name: Build doc
working-directory: ./rust
run: cargo doc --no-deps --all-features
env:
RUSTDOCFLAGS: --cfg docsrs
msrv:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./rust
strategy:
matrix:
msrv: [1.61]
name: msrv ${{ matrix.msrv }} check
msrv: [1.70.0]
name: MSRV ${{ matrix.msrv }} check
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Install ${{ matrix.msrv }}
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.msrv }}
- name: Check MSRV ${{ matrix.msrv }}
working-directory: ./rust
run: cp .cargo/Cargo.lock.min Cargo.lock && cargo +${{ matrix.msrv }} fetch && cargo +${{ matrix.msrv }} check --locked --frozen
- name: Install cargo-msrv
run: |
cargo install cargo-msrv
cargo msrv --min ${{ matrix.msrv }}
build:
name: "${{ matrix.os }}"
runs-on: ${{ matrix.os }}
Expand All @@ -76,8 +82,8 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, macos-11, windows-2022]
msrv: [1.61]
os: [ubuntu-20.04, macos-12, windows-2022]
msrv: [1.70]
steps:
- uses: actions/checkout@v2
with:
Expand Down
4 changes: 2 additions & 2 deletions README-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
| Producer with timed/delay messages |||||| 🚧 || 🚧 |
| Producer with transactional messages |||||| 🚧 || 🚧 |
| Simple consumer |||||| 🚧 || 🚧 |
| Push consumer with concurrent message listener ||| 🚧 | 🚧 | 🚧 | 🚧 | 🚧 | 🚧 |
| Push consumer with FIFO message listener ||| 🚧 | 🚧 | 🚧 | 🚧 | 🚧 | 🚧 |
| Push consumer with concurrent message listener ||| 🚧 | 🚧 | | 🚧 | 🚧 | 🚧 |
| Push consumer with FIFO message listener ||| 🚧 | 🚧 | | 🚧 | 🚧 | 🚧 |

## 先决条件和构建

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ Provide cloud-native and robust solutions for Java, C++, C#, Golang, Rust and al
| Producer with timed/delay messages |||||| 🚧 || 🚧 |
| Producer with transactional messages |||||| 🚧 || 🚧 |
| Simple consumer |||||| 🚧 || 🚧 |
| Push consumer with concurrent message listener ||| 🚧 | 🚧 | 🚧 | 🚧 | 🚧 | 🚧 |
| Push consumer with FIFO message listener ||| 🚧 | 🚧 | 🚧 | 🚧 | 🚧 | 🚧 |
| Push consumer with concurrent message listener ||| 🚧 | 🚧 | | 🚧 | 🚧 | 🚧 |
| Push consumer with FIFO message listener ||| 🚧 | 🚧 | | 🚧 | 🚧 | 🚧 |

## Prerequisite and Build

Expand Down
Loading

0 comments on commit 18577c2

Please sign in to comment.