Compare commits
71 Commits
v0.2.0
...
689bfd1325
| Author | SHA1 | Date | |
|---|---|---|---|
|
689bfd1325
|
|||
|
f0c90edce9
|
|||
| 5e60a272f7 | |||
| 34d609937d | |||
| 094b14c945 | |||
| f6d4f846fc | |||
| 7f3139f4f9 | |||
| 494ec05874 | |||
|
8c0128612f
|
|||
| cbe049b6a2 | |||
|
2d6b14ad77
|
|||
| f777ec9b1e | |||
| 2415088792 | |||
| a35d15edc2 | |||
| 613947ac88 | |||
| 145e067454 | |||
|
82de5b260f
|
|||
| eb360e565c | |||
|
c18c8a885c
|
|||
|
762da1e672
|
|||
| 3bc512ab48 | |||
|
7d8071d41b
|
|||
|
1cc4138ec7
|
|||
|
00517daaaa
|
|||
| b941dc9a76 | |||
|
5da3c83c12
|
|||
| a16bee8e37 | |||
|
a61f00a79d
|
|||
| 2bd9bd7b8e | |||
| c79ff2fde0 | |||
| c29a84d15e | |||
| 01274c1364 | |||
| 9c3f2cb7f7 | |||
| 9489f1a5a8 | |||
| f6aba7fac6 | |||
| 772366e267 | |||
| 1e08ee3dbb | |||
| 78f0c4057a | |||
| cf5d5268f6 | |||
| ce2479f6ca | |||
| 82d4699bca | |||
| 5ab7cae1fe | |||
| f049750e4c | |||
| 0b5f19fc77 | |||
| 14eabdbe82 | |||
| ea568449fe | |||
| 6ec3a6031e | |||
| 0f8fd2343e | |||
| 12c00941b5 | |||
| 72755f9cf1 | |||
|
ae0b8b703e
|
|||
| 3c3f638004 | |||
|
ea5287152c
|
|||
| 14371cdfd7 | |||
| 3a1b1673ef | |||
| 89cbae24d0 | |||
|
7c1b317d08
|
|||
|
1fec4e3708
|
|||
| 0eb24aa937 | |||
|
5c88cdd3e3
|
|||
|
d51716893f
|
|||
|
ff350f9193
|
|||
|
3d774f6d9c
|
|||
|
b78423377c
|
|||
| 1446f4c3cf | |||
|
8a80480d94
|
|||
|
b7b2992730
|
|||
| 61cbec0477 | |||
|
10e2739b6e
|
|||
| ffa3efd99c | |||
|
7c08d7a5df
|
125
CHANGELOG.md
125
CHANGELOG.md
@@ -6,6 +6,131 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [0.10.0] - 2025-11-15
|
||||
|
||||
### Added
|
||||
- implement take errors
|
||||
|
||||
## [0.9.0] - 2025-11-15
|
||||
|
||||
### Added
|
||||
- mad not properly surfaces panics
|
||||
- add publish
|
||||
- add readme
|
||||
|
||||
### Fixed
|
||||
- *(deps)* update all dependencies (#38)
|
||||
|
||||
### Other
|
||||
- *(deps)* update rust crate tracing-subscriber to v0.3.20 (#37)
|
||||
|
||||
## [0.8.1] - 2025-08-09
|
||||
|
||||
### Other
|
||||
- error logging
|
||||
|
||||
## [0.8.0] - 2025-08-08
|
||||
|
||||
### Added
|
||||
- add docs
|
||||
- update readme
|
||||
|
||||
## [0.7.5] - 2025-07-24
|
||||
|
||||
### Added
|
||||
- print big inner
|
||||
|
||||
### Other
|
||||
- more error correction
|
||||
- correct error test to not be as verbose
|
||||
|
||||
## [0.7.4] - 2025-07-24
|
||||
|
||||
### Added
|
||||
- cleanup aggregate error for single error
|
||||
|
||||
## [0.7.3] - 2025-07-24
|
||||
|
||||
### Added
|
||||
- automatic conversion from anyhow::Error and access to aggregate errors
|
||||
|
||||
### Fixed
|
||||
- *(deps)* update all dependencies (#30)
|
||||
|
||||
## [0.7.2] - 2025-06-25
|
||||
|
||||
### Added
|
||||
- add wait
|
||||
- add conditional, allows adding or waiting for close
|
||||
|
||||
### Fixed
|
||||
- *(deps)* update rust crate async-trait to v0.1.86 (#28)
|
||||
- *(deps)* update rust crate rand to 0.9.0 (#27)
|
||||
- *(deps)* update rust crate thiserror to v2.0.11 (#26)
|
||||
- *(deps)* update all dependencies (#25)
|
||||
- *(deps)* update rust crate async-trait to v0.1.84 (#24)
|
||||
- *(deps)* update rust crate thiserror to v2.0.9 (#22)
|
||||
- *(deps)* update rust crate thiserror to v2.0.8 (#21)
|
||||
- *(deps)* update rust crate thiserror to v2.0.7 (#20)
|
||||
- *(deps)* update rust crate thiserror to v2.0.6 (#19)
|
||||
- *(deps)* update rust crate thiserror to v2.0.5 (#18)
|
||||
- *(deps)* update rust crate tokio-util to v0.7.13 (#17)
|
||||
|
||||
### Other
|
||||
- chore
|
||||
|
||||
- *(deps)* update all dependencies (#29)
|
||||
- *(deps)* update rust crate anyhow to v1.0.95 (#23)
|
||||
- *(deps)* update all dependencies (#16)
|
||||
- *(deps)* update rust crate tracing-subscriber to v0.3.19 (#15)
|
||||
- *(deps)* update rust crate tracing to v0.1.41 (#13)
|
||||
|
||||
## [0.7.1] - 2024-11-24
|
||||
|
||||
### Fixed
|
||||
- make sure to close on final
|
||||
|
||||
## [0.7.0] - 2024-11-24
|
||||
|
||||
### Added
|
||||
- actually bubble up errors
|
||||
|
||||
### Fixed
|
||||
- *(deps)* update rust crate thiserror to v2 (#9)
|
||||
|
||||
## [0.6.0] - 2024-11-23
|
||||
|
||||
### Added
|
||||
- adding test to make sure we can gracefully shutdown
|
||||
- make sure to close down properly
|
||||
|
||||
## [0.5.0] - 2024-11-19
|
||||
|
||||
### Added
|
||||
- update name
|
||||
- respect sigterm
|
||||
- include author
|
||||
- update with rename
|
||||
|
||||
### Docs
|
||||
- add examples
|
||||
|
||||
## [0.4.0] - 2024-08-07
|
||||
|
||||
### Added
|
||||
- add correction
|
||||
- add small docs
|
||||
|
||||
## [0.3.0] - 2024-08-07
|
||||
|
||||
### Added
|
||||
- add add_fn to execute immediate lambdas
|
||||
|
||||
## [0.2.1] - 2024-08-07
|
||||
|
||||
### Docs
|
||||
- add a small readme
|
||||
|
||||
## [0.2.0] - 2024-08-07
|
||||
|
||||
### Added
|
||||
|
||||
482
Cargo.lock
generated
482
Cargo.lock
generated
@@ -1,21 +1,6 @@
|
||||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
version = 3
|
||||
|
||||
[[package]]
|
||||
name = "addr2line"
|
||||
version = "0.22.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678"
|
||||
dependencies = [
|
||||
"gimli",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "adler"
|
||||
version = "1.0.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
|
||||
version = 4
|
||||
|
||||
[[package]]
|
||||
name = "aho-corasick"
|
||||
@@ -28,41 +13,15 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "anyhow"
|
||||
version = "1.0.86"
|
||||
version = "1.0.100"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da"
|
||||
|
||||
[[package]]
|
||||
name = "async-trait"
|
||||
version = "0.1.81"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
]
|
||||
checksum = "a23eb6b1614318a8071c9b2521f36b424b2c83db5eb3a0fead4a6c0809af6e61"
|
||||
|
||||
[[package]]
|
||||
name = "autocfg"
|
||||
version = "1.3.0"
|
||||
version = "1.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0"
|
||||
|
||||
[[package]]
|
||||
name = "backtrace"
|
||||
version = "0.3.73"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a"
|
||||
dependencies = [
|
||||
"addr2line",
|
||||
"cc",
|
||||
"cfg-if",
|
||||
"libc",
|
||||
"miniz_oxide",
|
||||
"object",
|
||||
"rustc-demangle",
|
||||
]
|
||||
checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26"
|
||||
|
||||
[[package]]
|
||||
name = "bitflags"
|
||||
@@ -78,15 +37,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"
|
||||
|
||||
[[package]]
|
||||
name = "bytes"
|
||||
version = "1.7.1"
|
||||
version = "1.8.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50"
|
||||
|
||||
[[package]]
|
||||
name = "cc"
|
||||
version = "1.1.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "26a5c3fd7bfa1ce3897a3a3501d362b2d87b7f2583ebcb4a949ec25911025cbc"
|
||||
checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da"
|
||||
|
||||
[[package]]
|
||||
name = "cfg-if"
|
||||
@@ -96,9 +49,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
|
||||
|
||||
[[package]]
|
||||
name = "futures"
|
||||
version = "0.3.30"
|
||||
version = "0.3.31"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0"
|
||||
checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876"
|
||||
dependencies = [
|
||||
"futures-channel",
|
||||
"futures-core",
|
||||
@@ -111,9 +64,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "futures-channel"
|
||||
version = "0.3.30"
|
||||
version = "0.3.31"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78"
|
||||
checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10"
|
||||
dependencies = [
|
||||
"futures-core",
|
||||
"futures-sink",
|
||||
@@ -121,15 +74,15 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "futures-core"
|
||||
version = "0.3.30"
|
||||
version = "0.3.31"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d"
|
||||
checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e"
|
||||
|
||||
[[package]]
|
||||
name = "futures-executor"
|
||||
version = "0.3.30"
|
||||
version = "0.3.31"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d"
|
||||
checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f"
|
||||
dependencies = [
|
||||
"futures-core",
|
||||
"futures-task",
|
||||
@@ -138,15 +91,15 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "futures-io"
|
||||
version = "0.3.30"
|
||||
version = "0.3.31"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1"
|
||||
checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6"
|
||||
|
||||
[[package]]
|
||||
name = "futures-macro"
|
||||
version = "0.3.30"
|
||||
version = "0.3.31"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac"
|
||||
checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
@@ -155,21 +108,21 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "futures-sink"
|
||||
version = "0.3.30"
|
||||
version = "0.3.31"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5"
|
||||
checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7"
|
||||
|
||||
[[package]]
|
||||
name = "futures-task"
|
||||
version = "0.3.30"
|
||||
version = "0.3.31"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004"
|
||||
checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988"
|
||||
|
||||
[[package]]
|
||||
name = "futures-util"
|
||||
version = "0.3.30"
|
||||
version = "0.3.31"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48"
|
||||
checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81"
|
||||
dependencies = [
|
||||
"futures-channel",
|
||||
"futures-core",
|
||||
@@ -185,21 +138,16 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "getrandom"
|
||||
version = "0.2.15"
|
||||
version = "0.3.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7"
|
||||
checksum = "43a49c392881ce6d5c3b8cb70f98717b7c07aabbdff06687b9030dbfbe2725f8"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"libc",
|
||||
"wasi",
|
||||
"wasi 0.13.3+wasi-0.2.2",
|
||||
"windows-targets 0.52.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "gimli"
|
||||
version = "0.29.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd"
|
||||
|
||||
[[package]]
|
||||
name = "hermit-abi"
|
||||
version = "0.3.9"
|
||||
@@ -214,9 +162,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
|
||||
|
||||
[[package]]
|
||||
name = "libc"
|
||||
version = "0.2.155"
|
||||
version = "0.2.177"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c"
|
||||
checksum = "2874a2af47a2325c2001a6e6fad9b16a53b802102b528163885171cf92b15976"
|
||||
|
||||
[[package]]
|
||||
name = "lock_api"
|
||||
@@ -234,29 +182,13 @@ version = "0.4.22"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24"
|
||||
|
||||
[[package]]
|
||||
name = "mad"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"async-trait",
|
||||
"futures",
|
||||
"futures-util",
|
||||
"rand",
|
||||
"thiserror",
|
||||
"tokio",
|
||||
"tokio-util",
|
||||
"tracing",
|
||||
"tracing-test",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "matchers"
|
||||
version = "0.1.0"
|
||||
version = "0.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558"
|
||||
checksum = "d1525a2a28c7f4fa0fc98bb91ae755d1e2d1505079e05539e35bc876b5d65ae9"
|
||||
dependencies = [
|
||||
"regex-automata 0.1.10",
|
||||
"regex-automata",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -265,57 +197,48 @@ version = "2.7.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3"
|
||||
|
||||
[[package]]
|
||||
name = "miniz_oxide"
|
||||
version = "0.7.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08"
|
||||
dependencies = [
|
||||
"adler",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "mio"
|
||||
version = "1.0.1"
|
||||
version = "1.0.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4569e456d394deccd22ce1c1913e6ea0e54519f577285001215d33557431afe4"
|
||||
checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec"
|
||||
dependencies = [
|
||||
"hermit-abi",
|
||||
"libc",
|
||||
"wasi",
|
||||
"windows-sys",
|
||||
"wasi 0.11.0+wasi-snapshot-preview1",
|
||||
"windows-sys 0.52.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "notmad"
|
||||
version = "0.10.0"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"futures",
|
||||
"futures-util",
|
||||
"rand",
|
||||
"thiserror",
|
||||
"tokio",
|
||||
"tokio-util",
|
||||
"tracing",
|
||||
"tracing-subscriber",
|
||||
"tracing-test",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "nu-ansi-term"
|
||||
version = "0.46.0"
|
||||
version = "0.50.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84"
|
||||
checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5"
|
||||
dependencies = [
|
||||
"overload",
|
||||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "object"
|
||||
version = "0.36.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "27b64972346851a39438c60b341ebc01bba47464ae329e55cf343eb93964efd9"
|
||||
dependencies = [
|
||||
"memchr",
|
||||
"windows-sys 0.61.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "once_cell"
|
||||
version = "1.19.0"
|
||||
version = "1.20.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92"
|
||||
|
||||
[[package]]
|
||||
name = "overload"
|
||||
version = "0.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39"
|
||||
checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775"
|
||||
|
||||
[[package]]
|
||||
name = "parking_lot"
|
||||
@@ -337,14 +260,14 @@ dependencies = [
|
||||
"libc",
|
||||
"redox_syscall",
|
||||
"smallvec",
|
||||
"windows-targets",
|
||||
"windows-targets 0.52.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pin-project-lite"
|
||||
version = "0.2.14"
|
||||
version = "0.2.15"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02"
|
||||
checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff"
|
||||
|
||||
[[package]]
|
||||
name = "pin-utils"
|
||||
@@ -358,43 +281,42 @@ version = "0.2.20"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04"
|
||||
dependencies = [
|
||||
"zerocopy",
|
||||
"zerocopy 0.7.35",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "proc-macro2"
|
||||
version = "1.0.86"
|
||||
version = "1.0.89"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77"
|
||||
checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e"
|
||||
dependencies = [
|
||||
"unicode-ident",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "quote"
|
||||
version = "1.0.36"
|
||||
version = "1.0.37"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7"
|
||||
checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rand"
|
||||
version = "0.8.5"
|
||||
version = "0.9.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404"
|
||||
checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"rand_chacha",
|
||||
"rand_core",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rand_chacha"
|
||||
version = "0.3.1"
|
||||
version = "0.9.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88"
|
||||
checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb"
|
||||
dependencies = [
|
||||
"ppv-lite86",
|
||||
"rand_core",
|
||||
@@ -402,71 +324,39 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "rand_core"
|
||||
version = "0.6.4"
|
||||
version = "0.9.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
|
||||
checksum = "b08f3c9802962f7e1b25113931d94f43ed9725bebc59db9d0c3e9a23b67e15ff"
|
||||
dependencies = [
|
||||
"getrandom",
|
||||
"zerocopy 0.8.14",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "redox_syscall"
|
||||
version = "0.5.3"
|
||||
version = "0.5.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4"
|
||||
checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "regex"
|
||||
version = "1.10.6"
|
||||
name = "regex-automata"
|
||||
version = "0.4.9"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619"
|
||||
checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908"
|
||||
dependencies = [
|
||||
"aho-corasick",
|
||||
"memchr",
|
||||
"regex-automata 0.4.7",
|
||||
"regex-syntax 0.8.4",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "regex-automata"
|
||||
version = "0.1.10"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132"
|
||||
dependencies = [
|
||||
"regex-syntax 0.6.29",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "regex-automata"
|
||||
version = "0.4.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df"
|
||||
dependencies = [
|
||||
"aho-corasick",
|
||||
"memchr",
|
||||
"regex-syntax 0.8.4",
|
||||
"regex-syntax",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "regex-syntax"
|
||||
version = "0.6.29"
|
||||
version = "0.8.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1"
|
||||
|
||||
[[package]]
|
||||
name = "regex-syntax"
|
||||
version = "0.8.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b"
|
||||
|
||||
[[package]]
|
||||
name = "rustc-demangle"
|
||||
version = "0.1.24"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f"
|
||||
checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c"
|
||||
|
||||
[[package]]
|
||||
name = "scopeguard"
|
||||
@@ -509,19 +399,19 @@ checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67"
|
||||
|
||||
[[package]]
|
||||
name = "socket2"
|
||||
version = "0.5.7"
|
||||
version = "0.6.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c"
|
||||
checksum = "17129e116933cf371d018bb80ae557e889637989d8638274fb25622827b03881"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"windows-sys",
|
||||
"windows-sys 0.60.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "syn"
|
||||
version = "2.0.72"
|
||||
version = "2.0.87"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af"
|
||||
checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
@@ -530,18 +420,18 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "thiserror"
|
||||
version = "1.0.63"
|
||||
version = "2.0.18"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724"
|
||||
checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4"
|
||||
dependencies = [
|
||||
"thiserror-impl",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "thiserror-impl"
|
||||
version = "1.0.63"
|
||||
version = "2.0.18"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261"
|
||||
checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
@@ -560,11 +450,10 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tokio"
|
||||
version = "1.39.2"
|
||||
version = "1.49.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "daa4fb1bc778bd6f04cbfc4bb2d06a7396a8f299dc33ea1900cedaa316f467b1"
|
||||
checksum = "72a2903cd7736441aac9df9d7688bd0ce48edccaadf181c3b90be801e81d3d86"
|
||||
dependencies = [
|
||||
"backtrace",
|
||||
"bytes",
|
||||
"libc",
|
||||
"mio",
|
||||
@@ -573,14 +462,14 @@ dependencies = [
|
||||
"signal-hook-registry",
|
||||
"socket2",
|
||||
"tokio-macros",
|
||||
"windows-sys",
|
||||
"windows-sys 0.61.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tokio-macros"
|
||||
version = "2.4.0"
|
||||
version = "2.6.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752"
|
||||
checksum = "af407857209536a95c8e56f8231ef2c2e2aff839b22e07a1ffcbc617e9db9fa5"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
@@ -589,9 +478,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tokio-util"
|
||||
version = "0.7.11"
|
||||
version = "0.7.18"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1"
|
||||
checksum = "9ae9cec805b01e8fc3fd2fe289f89149a9b66dd16786abd8b19cfa7b48cb0098"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"futures-core",
|
||||
@@ -602,9 +491,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tracing"
|
||||
version = "0.1.40"
|
||||
version = "0.1.44"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef"
|
||||
checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100"
|
||||
dependencies = [
|
||||
"log",
|
||||
"pin-project-lite",
|
||||
@@ -614,9 +503,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tracing-attributes"
|
||||
version = "0.1.27"
|
||||
version = "0.1.31"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7"
|
||||
checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
@@ -625,9 +514,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tracing-core"
|
||||
version = "0.1.32"
|
||||
version = "0.1.36"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54"
|
||||
checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a"
|
||||
dependencies = [
|
||||
"once_cell",
|
||||
"valuable",
|
||||
@@ -646,14 +535,14 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tracing-subscriber"
|
||||
version = "0.3.18"
|
||||
version = "0.3.22"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b"
|
||||
checksum = "2f30143827ddab0d256fd843b7a66d164e9f271cfa0dde49142c5ca0ca291f1e"
|
||||
dependencies = [
|
||||
"matchers",
|
||||
"nu-ansi-term",
|
||||
"once_cell",
|
||||
"regex",
|
||||
"regex-automata",
|
||||
"sharded-slab",
|
||||
"smallvec",
|
||||
"thread_local",
|
||||
@@ -685,9 +574,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "unicode-ident"
|
||||
version = "1.0.12"
|
||||
version = "1.0.13"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"
|
||||
checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe"
|
||||
|
||||
[[package]]
|
||||
name = "valuable"
|
||||
@@ -702,26 +591,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
|
||||
|
||||
[[package]]
|
||||
name = "winapi"
|
||||
version = "0.3.9"
|
||||
name = "wasi"
|
||||
version = "0.13.3+wasi-0.2.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
|
||||
checksum = "26816d2e1a4a36a2940b96c5296ce403917633dff8f3440e9b236ed6f6bacad2"
|
||||
dependencies = [
|
||||
"winapi-i686-pc-windows-gnu",
|
||||
"winapi-x86_64-pc-windows-gnu",
|
||||
"wit-bindgen-rt",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "winapi-i686-pc-windows-gnu"
|
||||
version = "0.4.0"
|
||||
name = "windows-link"
|
||||
version = "0.2.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
|
||||
|
||||
[[package]]
|
||||
name = "winapi-x86_64-pc-windows-gnu"
|
||||
version = "0.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
|
||||
checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"
|
||||
|
||||
[[package]]
|
||||
name = "windows-sys"
|
||||
@@ -729,7 +611,25 @@ version = "0.52.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
|
||||
dependencies = [
|
||||
"windows-targets",
|
||||
"windows-targets 0.52.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "windows-sys"
|
||||
version = "0.60.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb"
|
||||
dependencies = [
|
||||
"windows-targets 0.53.5",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "windows-sys"
|
||||
version = "0.61.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc"
|
||||
dependencies = [
|
||||
"windows-link",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -738,14 +638,31 @@ version = "0.52.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973"
|
||||
dependencies = [
|
||||
"windows_aarch64_gnullvm",
|
||||
"windows_aarch64_msvc",
|
||||
"windows_i686_gnu",
|
||||
"windows_i686_gnullvm",
|
||||
"windows_i686_msvc",
|
||||
"windows_x86_64_gnu",
|
||||
"windows_x86_64_gnullvm",
|
||||
"windows_x86_64_msvc",
|
||||
"windows_aarch64_gnullvm 0.52.6",
|
||||
"windows_aarch64_msvc 0.52.6",
|
||||
"windows_i686_gnu 0.52.6",
|
||||
"windows_i686_gnullvm 0.52.6",
|
||||
"windows_i686_msvc 0.52.6",
|
||||
"windows_x86_64_gnu 0.52.6",
|
||||
"windows_x86_64_gnullvm 0.52.6",
|
||||
"windows_x86_64_msvc 0.52.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "windows-targets"
|
||||
version = "0.53.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3"
|
||||
dependencies = [
|
||||
"windows-link",
|
||||
"windows_aarch64_gnullvm 0.53.1",
|
||||
"windows_aarch64_msvc 0.53.1",
|
||||
"windows_i686_gnu 0.53.1",
|
||||
"windows_i686_gnullvm 0.53.1",
|
||||
"windows_i686_msvc 0.53.1",
|
||||
"windows_x86_64_gnu 0.53.1",
|
||||
"windows_x86_64_gnullvm 0.53.1",
|
||||
"windows_x86_64_msvc 0.53.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -754,48 +671,105 @@ version = "0.52.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
|
||||
|
||||
[[package]]
|
||||
name = "windows_aarch64_gnullvm"
|
||||
version = "0.53.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53"
|
||||
|
||||
[[package]]
|
||||
name = "windows_aarch64_msvc"
|
||||
version = "0.52.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
|
||||
|
||||
[[package]]
|
||||
name = "windows_aarch64_msvc"
|
||||
version = "0.53.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006"
|
||||
|
||||
[[package]]
|
||||
name = "windows_i686_gnu"
|
||||
version = "0.52.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
|
||||
|
||||
[[package]]
|
||||
name = "windows_i686_gnu"
|
||||
version = "0.53.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3"
|
||||
|
||||
[[package]]
|
||||
name = "windows_i686_gnullvm"
|
||||
version = "0.52.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
|
||||
|
||||
[[package]]
|
||||
name = "windows_i686_gnullvm"
|
||||
version = "0.53.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c"
|
||||
|
||||
[[package]]
|
||||
name = "windows_i686_msvc"
|
||||
version = "0.52.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
|
||||
|
||||
[[package]]
|
||||
name = "windows_i686_msvc"
|
||||
version = "0.53.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2"
|
||||
|
||||
[[package]]
|
||||
name = "windows_x86_64_gnu"
|
||||
version = "0.52.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
|
||||
|
||||
[[package]]
|
||||
name = "windows_x86_64_gnu"
|
||||
version = "0.53.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499"
|
||||
|
||||
[[package]]
|
||||
name = "windows_x86_64_gnullvm"
|
||||
version = "0.52.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
|
||||
|
||||
[[package]]
|
||||
name = "windows_x86_64_gnullvm"
|
||||
version = "0.53.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1"
|
||||
|
||||
[[package]]
|
||||
name = "windows_x86_64_msvc"
|
||||
version = "0.52.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
|
||||
|
||||
[[package]]
|
||||
name = "windows_x86_64_msvc"
|
||||
version = "0.53.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650"
|
||||
|
||||
[[package]]
|
||||
name = "wit-bindgen-rt"
|
||||
version = "0.33.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3268f3d866458b787f390cf61f4bbb563b922d091359f9608842999eaee3943c"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "zerocopy"
|
||||
version = "0.7.35"
|
||||
@@ -803,7 +777,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0"
|
||||
dependencies = [
|
||||
"byteorder",
|
||||
"zerocopy-derive",
|
||||
"zerocopy-derive 0.7.35",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "zerocopy"
|
||||
version = "0.8.14"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a367f292d93d4eab890745e75a778da40909cab4d6ff8173693812f79c4a2468"
|
||||
dependencies = [
|
||||
"zerocopy-derive 0.8.14",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -816,3 +799,14 @@ dependencies = [
|
||||
"quote",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "zerocopy-derive"
|
||||
version = "0.8.14"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d3931cb58c62c13adec22e38686b559c86a30565e16ad6e8510a337cedc611e1"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
]
|
||||
|
||||
@@ -3,10 +3,9 @@ members = ["crates/*"]
|
||||
resolver = "2"
|
||||
|
||||
[workspace.package]
|
||||
version = "0.2.0"
|
||||
version = "0.10.0"
|
||||
|
||||
[workspace.dependencies]
|
||||
mad = { path = "crates/mad" }
|
||||
|
||||
anyhow = { version = "1.0.71" }
|
||||
tokio = { version = "1", features = ["full"] }
|
||||
|
||||
166
README.md
Normal file
166
README.md
Normal file
@@ -0,0 +1,166 @@
|
||||
# MAD - Lifecycle Manager for Rust Applications
|
||||
|
||||
[](https://crates.io/crates/notmad)
|
||||
[](https://docs.rs/notmad)
|
||||
[](https://opensource.org/licenses/MIT)
|
||||
|
||||
A simple lifecycle manager for long-running Rust applications. Run multiple services concurrently with graceful shutdown handling.
|
||||
|
||||
## Installation
|
||||
|
||||
```toml
|
||||
[dependencies]
|
||||
notmad = "0.10.0"
|
||||
tokio = { version = "1", features = ["full"] }
|
||||
```
|
||||
|
||||
## Quick Start
|
||||
|
||||
```rust
|
||||
use notmad::{Component, Mad};
|
||||
use tokio_util::sync::CancellationToken;
|
||||
|
||||
struct MyService;
|
||||
|
||||
impl Component for MyService {
|
||||
async fn run(&self, cancellation: CancellationToken) -> Result<(), notmad::MadError> {
|
||||
println!("Service running...");
|
||||
cancellation.cancelled().await;
|
||||
println!("Service stopped");
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> anyhow::Result<()> {
|
||||
Mad::builder()
|
||||
.add(MyService)
|
||||
.run()
|
||||
.await?;
|
||||
Ok(())
|
||||
}
|
||||
```
|
||||
|
||||
## Basic Usage
|
||||
|
||||
### Axum Web Server with Graceful Shutdown
|
||||
|
||||
Here's how to run an Axum server with MAD's graceful shutdown:
|
||||
|
||||
```rust
|
||||
use axum::{Router, routing::get};
|
||||
use notmad::{Component, ComponentInfo};
|
||||
use tokio_util::sync::CancellationToken;
|
||||
|
||||
struct WebServer {
|
||||
port: u16,
|
||||
}
|
||||
|
||||
impl Component for WebServer {
|
||||
fn info(&self) -> ComponentInfo {
|
||||
format!("WebServer:{}", self.port).into()
|
||||
}
|
||||
|
||||
async fn run(&self, cancel: CancellationToken) -> Result<(), notmad::MadError> {
|
||||
let app = Router::new().route("/", get(|| async { "Hello, World!" }));
|
||||
|
||||
let listener = tokio::net::TcpListener::bind(format!("0.0.0.0:{}", self.port))
|
||||
.await?;
|
||||
|
||||
println!("Listening on http://0.0.0.0:{}", self.port);
|
||||
|
||||
// Run server with graceful shutdown
|
||||
axum::serve(listener, app)
|
||||
.with_graceful_shutdown(async move {
|
||||
cancel.cancelled().await;
|
||||
println!("Shutting down server...");
|
||||
})
|
||||
.await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Run Multiple Services
|
||||
|
||||
```rust
|
||||
Mad::builder()
|
||||
.add(WebServer { port: 8080 })
|
||||
.add(WebServer { port: 8081 })
|
||||
.run()
|
||||
.await?;
|
||||
```
|
||||
|
||||
### Use Functions as Components
|
||||
|
||||
```rust
|
||||
Mad::builder()
|
||||
.add_fn(|cancel| async move {
|
||||
println!("Running...");
|
||||
cancel.cancelled().await;
|
||||
Ok(())
|
||||
})
|
||||
.run()
|
||||
.await?;
|
||||
```
|
||||
|
||||
## Lifecycle Hooks
|
||||
|
||||
Components support optional setup and cleanup phases:
|
||||
|
||||
```rust
|
||||
impl Component for DatabaseService {
|
||||
async fn setup(&self) -> Result<(), notmad::MadError> {
|
||||
println!("Connecting to database...");
|
||||
Ok(())
|
||||
}
|
||||
|
||||
async fn run(&self, cancel: CancellationToken) -> Result<(), notmad::MadError> {
|
||||
cancel.cancelled().await;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
async fn close(&self) -> Result<(), notmad::MadError> {
|
||||
println!("Closing database connection...");
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Migration from v0.9
|
||||
|
||||
### Breaking Changes
|
||||
|
||||
1. **`name()` → `info()`**: Returns `ComponentInfo` instead of `Option<String>`
|
||||
```rust
|
||||
// Before
|
||||
fn name(&self) -> Option<String> { Some("my-service".into()) }
|
||||
|
||||
// After
|
||||
fn info(&self) -> ComponentInfo { "my-service".into() }
|
||||
```
|
||||
|
||||
2. **No more `async-trait`**: Remove the dependency and `#[async_trait]` attribute
|
||||
```rust
|
||||
// Before
|
||||
#[async_trait]
|
||||
impl Component for MyService { }
|
||||
|
||||
// After
|
||||
impl Component for MyService { }
|
||||
```
|
||||
|
||||
## Examples
|
||||
|
||||
See [examples directory](crates/mad/examples) for complete working examples.
|
||||
|
||||
## License
|
||||
|
||||
MIT - see [LICENSE](LICENSE)
|
||||
|
||||
## Links
|
||||
|
||||
- [Documentation](https://docs.rs/notmad)
|
||||
- [Repository](https://github.com/kjuulh/mad)
|
||||
- [Crates.io](https://crates.io/crates/notmad)
|
||||
@@ -1,18 +1,23 @@
|
||||
[package]
|
||||
name = "mad"
|
||||
name = "notmad"
|
||||
version.workspace = true
|
||||
edition = "2021"
|
||||
description = "notmad is a life-cycle manager for long running rust operations"
|
||||
license = "MIT"
|
||||
repository = "https://github.com/kjuulh/mad"
|
||||
authors = ["kjuulh"]
|
||||
edition = "2024"
|
||||
readme = "../../README.md"
|
||||
|
||||
[dependencies]
|
||||
anyhow.workspace = true
|
||||
async-trait = "0.1.81"
|
||||
futures = "0.3.30"
|
||||
futures-util = "0.3.30"
|
||||
rand = "0.8.5"
|
||||
thiserror = "1.0.63"
|
||||
rand = "0.9.0"
|
||||
thiserror = "2.0.0"
|
||||
tokio.workspace = true
|
||||
tokio-util = "0.7.11"
|
||||
tracing.workspace = true
|
||||
|
||||
[dev-dependencies]
|
||||
tracing-subscriber = "0.3.18"
|
||||
tracing-test = { version = "0.2.5", features = ["no-env-filter"] }
|
||||
|
||||
39
crates/mad/examples/basic/main.rs
Normal file
39
crates/mad/examples/basic/main.rs
Normal file
@@ -0,0 +1,39 @@
|
||||
use notmad::ComponentInfo;
|
||||
use rand::Rng;
|
||||
use tokio_util::sync::CancellationToken;
|
||||
use tracing::Level;
|
||||
|
||||
struct WaitServer {}
|
||||
impl notmad::Component for WaitServer {
|
||||
fn info(&self) -> ComponentInfo {
|
||||
"WaitServer".into()
|
||||
}
|
||||
|
||||
async fn run(&self, _cancellation: CancellationToken) -> Result<(), notmad::MadError> {
|
||||
let millis_wait = rand::thread_rng().gen_range(500..3000);
|
||||
|
||||
tracing::debug!("waiting: {}ms", millis_wait);
|
||||
|
||||
// Simulates a server running for some time. Is normally supposed to be futures blocking indefinitely
|
||||
tokio::time::sleep(std::time::Duration::from_millis(millis_wait)).await;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> anyhow::Result<()> {
|
||||
tracing_subscriber::fmt()
|
||||
.with_max_level(Level::TRACE)
|
||||
.init();
|
||||
|
||||
notmad::Mad::builder()
|
||||
.add(WaitServer {})
|
||||
.add(WaitServer {})
|
||||
.add(WaitServer {})
|
||||
.add(WaitServer {})
|
||||
.run()
|
||||
.await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
18
crates/mad/examples/comprehensive/Cargo.toml
Normal file
18
crates/mad/examples/comprehensive/Cargo.toml
Normal file
@@ -0,0 +1,18 @@
|
||||
[package]
|
||||
name = "mad-comprehensive-example"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
[[bin]]
|
||||
name = "comprehensive"
|
||||
path = "main.rs"
|
||||
|
||||
[dependencies]
|
||||
notmad = { path = "../.." }
|
||||
tokio = { version = "1", features = ["full"] }
|
||||
tokio-util = "0.7"
|
||||
async-trait = "0.1"
|
||||
anyhow = "1"
|
||||
tracing = "0.1"
|
||||
tracing-subscriber = "0.3"
|
||||
rand = "0.8"
|
||||
326
crates/mad/examples/comprehensive/main.rs
Normal file
326
crates/mad/examples/comprehensive/main.rs
Normal file
@@ -0,0 +1,326 @@
|
||||
//! Comprehensive example demonstrating MAD's full capabilities.
|
||||
//!
|
||||
//! This example shows:
|
||||
//! - Multiple component types (struct, closure, conditional)
|
||||
//! - Component lifecycle (setup, run, close)
|
||||
//! - Error handling and propagation
|
||||
//! - Graceful shutdown with cancellation tokens
|
||||
//! - Concurrent component execution
|
||||
|
||||
use notmad::{Component, ComponentInfo, Mad, MadError};
|
||||
use std::sync::Arc;
|
||||
use std::sync::atomic::{AtomicUsize, Ordering};
|
||||
use tokio::time::{Duration, interval};
|
||||
use tokio_util::sync::CancellationToken;
|
||||
use tracing::{error, info, warn};
|
||||
|
||||
/// A web server component that simulates handling HTTP requests.
|
||||
struct WebServer {
|
||||
port: u16,
|
||||
request_count: Arc<AtomicUsize>,
|
||||
}
|
||||
|
||||
impl Component for WebServer {
|
||||
fn info(&self) -> ComponentInfo {
|
||||
format!("web-server-{}", self.port).into()
|
||||
}
|
||||
|
||||
async fn setup(&self) -> Result<(), MadError> {
|
||||
info!("Setting up web server on port {}", self.port);
|
||||
// In a real application, you might:
|
||||
// - Bind to the port
|
||||
// - Set up TLS certificates
|
||||
// - Initialize middleware
|
||||
tokio::time::sleep(Duration::from_millis(100)).await;
|
||||
info!("Web server on port {} is ready", self.port);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
async fn run(&self, cancellation: CancellationToken) -> Result<(), MadError> {
|
||||
info!("Web server on port {} started", self.port);
|
||||
let mut interval = interval(Duration::from_secs(1));
|
||||
|
||||
while !cancellation.is_cancelled() {
|
||||
tokio::select! {
|
||||
_ = cancellation.cancelled() => {
|
||||
info!("Web server on port {} received shutdown signal", self.port);
|
||||
break;
|
||||
}
|
||||
_ = interval.tick() => {
|
||||
// Simulate handling requests
|
||||
let count = self.request_count.fetch_add(1, Ordering::Relaxed);
|
||||
info!("Server on port {} handled request #{}", self.port, count + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
async fn close(&self) -> Result<(), MadError> {
|
||||
info!("Shutting down web server on port {}", self.port);
|
||||
// In a real application, you might:
|
||||
// - Drain existing connections
|
||||
// - Save server state
|
||||
// - Close database connections
|
||||
tokio::time::sleep(Duration::from_millis(200)).await;
|
||||
let total = self.request_count.load(Ordering::Relaxed);
|
||||
info!(
|
||||
"Web server on port {} shut down. Total requests handled: {}",
|
||||
self.port, total
|
||||
);
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
/// A background job processor that simulates processing tasks from a queue.
|
||||
struct JobProcessor {
|
||||
queue_name: String,
|
||||
processing_interval: Duration,
|
||||
}
|
||||
|
||||
impl Component for JobProcessor {
|
||||
fn info(&self) -> ComponentInfo {
|
||||
format!("job-processor-{}", self.queue_name).into()
|
||||
}
|
||||
|
||||
async fn setup(&self) -> Result<(), MadError> {
|
||||
info!("Connecting to queue: {}", self.queue_name);
|
||||
// Simulate connecting to a message queue
|
||||
tokio::time::sleep(Duration::from_millis(150)).await;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
async fn run(&self, cancellation: CancellationToken) -> Result<(), MadError> {
|
||||
info!("Job processor for {} started", self.queue_name);
|
||||
let mut interval = interval(self.processing_interval);
|
||||
let mut job_count = 0;
|
||||
|
||||
loop {
|
||||
tokio::select! {
|
||||
_ = cancellation.cancelled() => {
|
||||
info!("Job processor for {} stopping...", self.queue_name);
|
||||
break;
|
||||
}
|
||||
_ = interval.tick() => {
|
||||
job_count += 1;
|
||||
info!("Processing job #{} from {}", job_count, self.queue_name);
|
||||
|
||||
// Simulate job processing
|
||||
tokio::time::sleep(Duration::from_millis(100)).await;
|
||||
|
||||
// Simulate occasional errors (but don't fail the component)
|
||||
if job_count % 10 == 0 {
|
||||
warn!("Job #{} from {} required retry", job_count, self.queue_name);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
info!(
|
||||
"Job processor for {} processed {} jobs",
|
||||
self.queue_name, job_count
|
||||
);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
async fn close(&self) -> Result<(), MadError> {
|
||||
info!("Disconnecting from queue: {}", self.queue_name);
|
||||
tokio::time::sleep(Duration::from_millis(100)).await;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
/// A health check component that monitors system health.
|
||||
struct HealthChecker {
|
||||
check_interval: Duration,
|
||||
}
|
||||
|
||||
impl Component for HealthChecker {
|
||||
fn info(&self) -> ComponentInfo {
|
||||
"health-checker".into()
|
||||
}
|
||||
|
||||
async fn run(&self, cancellation: CancellationToken) -> Result<(), MadError> {
|
||||
info!("Health checker started");
|
||||
let mut interval = interval(self.check_interval);
|
||||
|
||||
while !cancellation.is_cancelled() {
|
||||
tokio::select! {
|
||||
_ = cancellation.cancelled() => {
|
||||
info!("Health checker stopping...");
|
||||
break;
|
||||
}
|
||||
_ = interval.tick() => {
|
||||
// Simulate health checks
|
||||
let cpu_usage = rand::random::<f32>() * 100.0;
|
||||
let memory_usage = rand::random::<f32>() * 100.0;
|
||||
|
||||
info!("System health: CPU={:.1}%, Memory={:.1}%", cpu_usage, memory_usage);
|
||||
|
||||
if cpu_usage > 90.0 {
|
||||
warn!("High CPU usage detected: {:.1}%", cpu_usage);
|
||||
}
|
||||
if memory_usage > 90.0 {
|
||||
warn!("High memory usage detected: {:.1}%", memory_usage);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
/// A component that will fail after some time to demonstrate error handling.
|
||||
struct FailingComponent {
|
||||
fail_after: Duration,
|
||||
}
|
||||
|
||||
impl Component for FailingComponent {
|
||||
fn info(&self) -> ComponentInfo {
|
||||
"failing-component".into()
|
||||
}
|
||||
|
||||
async fn run(&self, cancellation: CancellationToken) -> Result<(), MadError> {
|
||||
info!(
|
||||
"Failing component started (will fail after {:?})",
|
||||
self.fail_after
|
||||
);
|
||||
|
||||
tokio::select! {
|
||||
_ = cancellation.cancelled() => {
|
||||
info!("Failing component cancelled before failure");
|
||||
Ok(())
|
||||
}
|
||||
_ = tokio::time::sleep(self.fail_after) => {
|
||||
error!("Failing component encountered an error!");
|
||||
Err(anyhow::anyhow!("Simulated component failure").into())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Debug component that logs system status periodically.
|
||||
struct DebugComponent;
|
||||
|
||||
impl Component for DebugComponent {
|
||||
fn info(&self) -> ComponentInfo {
|
||||
"debug-component".into()
|
||||
}
|
||||
|
||||
async fn run(&self, cancel: CancellationToken) -> Result<(), MadError> {
|
||||
info!("Debug mode enabled - verbose logging active");
|
||||
let mut interval = interval(Duration::from_secs(5));
|
||||
|
||||
while !cancel.is_cancelled() {
|
||||
tokio::select! {
|
||||
_ = cancel.cancelled() => break,
|
||||
_ = interval.tick() => {
|
||||
info!("DEBUG: System running normally");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
info!("Debug component shutting down");
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> anyhow::Result<()> {
|
||||
// Initialize tracing for logging
|
||||
tracing_subscriber::fmt()
|
||||
.with_target(false)
|
||||
.without_time()
|
||||
.init();
|
||||
|
||||
info!("Starting comprehensive MAD example application");
|
||||
|
||||
// Check if we should enable the failing component
|
||||
let enable_failure_demo = std::env::var("ENABLE_FAILURE").is_ok();
|
||||
|
||||
// Check if we should enable debug mode
|
||||
let debug_mode = std::env::var("DEBUG").is_ok();
|
||||
|
||||
// Shared state for demonstration
|
||||
let request_count = Arc::new(AtomicUsize::new(0));
|
||||
|
||||
// Build and run the application
|
||||
let result = Mad::builder()
|
||||
// Add web servers
|
||||
.add(WebServer {
|
||||
port: 8080,
|
||||
request_count: request_count.clone(),
|
||||
})
|
||||
.add(WebServer {
|
||||
port: 8081,
|
||||
request_count: request_count.clone(),
|
||||
})
|
||||
// Add job processors
|
||||
.add(JobProcessor {
|
||||
queue_name: "high-priority".to_string(),
|
||||
processing_interval: Duration::from_secs(2),
|
||||
})
|
||||
.add(JobProcessor {
|
||||
queue_name: "low-priority".to_string(),
|
||||
processing_interval: Duration::from_secs(5),
|
||||
})
|
||||
// Add health checker
|
||||
.add(HealthChecker {
|
||||
check_interval: Duration::from_secs(3),
|
||||
})
|
||||
// Conditionally add a debug component using add_fn
|
||||
.add_conditional(debug_mode, DebugComponent)
|
||||
// Conditionally add failing component to demonstrate error handling
|
||||
.add_conditional(
|
||||
enable_failure_demo,
|
||||
FailingComponent {
|
||||
fail_after: Duration::from_secs(10),
|
||||
},
|
||||
)
|
||||
// Add a simple metrics reporter using add_fn
|
||||
.add_fn(|cancel: CancellationToken| async move {
|
||||
info!("Metrics reporter started");
|
||||
let mut interval = interval(Duration::from_secs(10));
|
||||
let start = std::time::Instant::now();
|
||||
|
||||
while !cancel.is_cancelled() {
|
||||
tokio::select! {
|
||||
_ = cancel.cancelled() => break,
|
||||
_ = interval.tick() => {
|
||||
let uptime = start.elapsed();
|
||||
info!("Application uptime: {:?}", uptime);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
info!("Metrics reporter stopped");
|
||||
Ok(())
|
||||
})
|
||||
// Configure graceful shutdown timeout
|
||||
.cancellation(Some(Duration::from_secs(5)))
|
||||
// Run the application
|
||||
.run()
|
||||
.await;
|
||||
|
||||
match result {
|
||||
Ok(()) => {
|
||||
info!("Application shut down successfully");
|
||||
Ok(())
|
||||
}
|
||||
Err(e) => {
|
||||
error!("Application failed: {}", e);
|
||||
|
||||
// Check if it's an aggregate error with multiple failures
|
||||
if let MadError::AggregateError(ref agg) = e {
|
||||
error!("Multiple component failures detected:");
|
||||
for (i, err) in agg.get_errors().iter().enumerate() {
|
||||
error!(" {}. {}", i + 1, err);
|
||||
}
|
||||
}
|
||||
|
||||
Err(e.into())
|
||||
}
|
||||
}
|
||||
}
|
||||
41
crates/mad/examples/error_log/main.rs
Normal file
41
crates/mad/examples/error_log/main.rs
Normal file
@@ -0,0 +1,41 @@
|
||||
use notmad::ComponentInfo;
|
||||
use rand::Rng;
|
||||
use tokio_util::sync::CancellationToken;
|
||||
use tracing::Level;
|
||||
|
||||
struct ErrorServer {}
|
||||
impl notmad::Component for ErrorServer {
|
||||
fn info(&self) -> ComponentInfo {
|
||||
"ErrorServer".into()
|
||||
}
|
||||
|
||||
async fn run(&self, _cancellation: CancellationToken) -> Result<(), notmad::MadError> {
|
||||
let millis_wait = rand::thread_rng().gen_range(500..3000);
|
||||
|
||||
tracing::debug!("waiting: {}ms", millis_wait);
|
||||
|
||||
// Simulates a server running for some time. Is normally supposed to be futures blocking indefinitely
|
||||
tokio::time::sleep(std::time::Duration::from_millis(millis_wait)).await;
|
||||
|
||||
Err(notmad::MadError::Inner(anyhow::anyhow!("expected error")))
|
||||
}
|
||||
}
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> anyhow::Result<()> {
|
||||
tracing_subscriber::fmt()
|
||||
.with_max_level(Level::TRACE)
|
||||
.init();
|
||||
|
||||
// Do note that only the first server which returns an error is guaranteed to be handled. This is because if servers don't respect cancellation, they will be dropped
|
||||
|
||||
notmad::Mad::builder()
|
||||
.add(ErrorServer {})
|
||||
.add(ErrorServer {})
|
||||
.add(ErrorServer {})
|
||||
.add(ErrorServer {})
|
||||
.run()
|
||||
.await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
66
crates/mad/examples/fn/main.rs
Normal file
66
crates/mad/examples/fn/main.rs
Normal file
@@ -0,0 +1,66 @@
|
||||
use notmad::ComponentInfo;
|
||||
use rand::Rng;
|
||||
use tokio_util::sync::CancellationToken;
|
||||
use tracing::Level;
|
||||
|
||||
struct WaitServer {}
|
||||
impl notmad::Component for WaitServer {
|
||||
fn info(&self) -> ComponentInfo {
|
||||
"WaitServer".into()
|
||||
}
|
||||
|
||||
async fn run(&self, _cancellation: CancellationToken) -> Result<(), notmad::MadError> {
|
||||
let millis_wait = rand::thread_rng().gen_range(500..3000);
|
||||
|
||||
tracing::debug!("waiting: {}ms", millis_wait);
|
||||
|
||||
// Simulates a server running for some time. Is normally supposed to be futures blocking indefinitely
|
||||
tokio::time::sleep(std::time::Duration::from_millis(millis_wait)).await;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> anyhow::Result<()> {
|
||||
tracing_subscriber::fmt()
|
||||
.with_max_level(Level::TRACE)
|
||||
.init();
|
||||
|
||||
let item = "some item".to_string();
|
||||
|
||||
notmad::Mad::builder()
|
||||
.add(WaitServer {})
|
||||
.add_fn(|_cancel| async move {
|
||||
let millis_wait = 50;
|
||||
|
||||
tracing::debug!("waiting: {}ms", millis_wait);
|
||||
|
||||
// Simulates a server running for some time. Is normally supposed to be futures blocking indefinitely
|
||||
tokio::time::sleep(std::time::Duration::from_millis(millis_wait)).await;
|
||||
|
||||
Ok(())
|
||||
})
|
||||
.add_fn(move |_cancel| {
|
||||
// I am an actual closure
|
||||
|
||||
let item = item.clone();
|
||||
|
||||
async move {
|
||||
let _item = item;
|
||||
|
||||
let millis_wait = 50;
|
||||
|
||||
tracing::debug!("waiting: {}ms", millis_wait);
|
||||
|
||||
// Simulates a server running for some time. Is normally supposed to be futures blocking indefinitely
|
||||
tokio::time::sleep(std::time::Duration::from_millis(millis_wait)).await;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
})
|
||||
.run()
|
||||
.await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
15
crates/mad/examples/multi_service/Cargo.toml
Normal file
15
crates/mad/examples/multi_service/Cargo.toml
Normal file
@@ -0,0 +1,15 @@
|
||||
[package]
|
||||
name = "mad-multi-service-example"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
[[bin]]
|
||||
name = "multi_service"
|
||||
path = "main.rs"
|
||||
|
||||
[dependencies]
|
||||
notmad = { path = "../.." }
|
||||
tokio = { version = "1", features = ["full"] }
|
||||
tokio-util = "0.7"
|
||||
async-trait = "0.1"
|
||||
anyhow = "1"
|
||||
210
crates/mad/examples/multi_service/main.rs
Normal file
210
crates/mad/examples/multi_service/main.rs
Normal file
@@ -0,0 +1,210 @@
|
||||
//! Example demonstrating running multiple services with MAD.
|
||||
//!
|
||||
//! This example shows how to run a web server, queue processor, and
|
||||
//! scheduled task together, with graceful shutdown on Ctrl+C.
|
||||
|
||||
use notmad::{Component, ComponentInfo, Mad, MadError};
|
||||
use tokio::time::{Duration, interval};
|
||||
use tokio_util::sync::CancellationToken;
|
||||
|
||||
/// A simple web server component.
|
||||
///
|
||||
/// In a real application, this would bind to a port and handle HTTP requests.
|
||||
/// Here we simulate it by periodically logging that we're "handling" requests.
|
||||
struct WebServer {
|
||||
port: u16,
|
||||
}
|
||||
|
||||
impl Component for WebServer {
|
||||
fn info(&self) -> ComponentInfo {
|
||||
format!("WebServer:{}", self.port).into()
|
||||
}
|
||||
|
||||
async fn setup(&self) -> Result<(), MadError> {
|
||||
println!("[{}] Binding to port...", self.info());
|
||||
// Simulate server setup time
|
||||
tokio::time::sleep(Duration::from_millis(100)).await;
|
||||
println!("[{}] Ready to accept connections", self.info());
|
||||
Ok(())
|
||||
}
|
||||
|
||||
async fn run(&self, cancellation: CancellationToken) -> Result<(), MadError> {
|
||||
println!("[{}] Server started", self.info());
|
||||
|
||||
// Simulate handling requests until shutdown
|
||||
let mut request_id = 0;
|
||||
let mut interval = interval(Duration::from_secs(2));
|
||||
|
||||
while !cancellation.is_cancelled() {
|
||||
tokio::select! {
|
||||
_ = cancellation.cancelled() => {
|
||||
println!("[{}] Shutdown signal received", self.info());
|
||||
break;
|
||||
}
|
||||
_ = interval.tick() => {
|
||||
request_id += 1;
|
||||
println!("[{}] Handling request #{}", self.info(), request_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
async fn close(&self) -> Result<(), MadError> {
|
||||
println!("[{}] Closing connections...", self.info());
|
||||
// Simulate graceful connection drain
|
||||
tokio::time::sleep(Duration::from_millis(200)).await;
|
||||
println!("[{}] Server stopped", self.info());
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
/// A queue processor that consumes messages from a queue.
|
||||
///
|
||||
/// This simulates processing messages from a message queue like
|
||||
/// RabbitMQ, Kafka, or AWS SQS.
|
||||
struct QueueProcessor {
|
||||
queue_name: String,
|
||||
}
|
||||
|
||||
impl Component for QueueProcessor {
|
||||
fn info(&self) -> ComponentInfo {
|
||||
format!("QueueProcessor:{}", self.queue_name).into()
|
||||
}
|
||||
|
||||
async fn run(&self, cancellation: CancellationToken) -> Result<(), MadError> {
|
||||
println!("[{}] Started processing", self.info());
|
||||
|
||||
let mut message_count = 0;
|
||||
|
||||
// Process messages until shutdown
|
||||
while !cancellation.is_cancelled() {
|
||||
// Simulate waiting for and processing a message
|
||||
tokio::select! {
|
||||
_ = cancellation.cancelled() => {
|
||||
println!("[{}] Stopping message processing", self.info());
|
||||
break;
|
||||
}
|
||||
_ = tokio::time::sleep(Duration::from_secs(1)) => {
|
||||
message_count += 1;
|
||||
println!("[{}] Processed message #{}", self.info(), message_count);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
println!(
|
||||
"[{}] Processed {} messages total",
|
||||
self.info(),
|
||||
message_count
|
||||
);
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
/// A scheduled task that runs periodically.
|
||||
///
|
||||
/// This could be used for tasks like:
|
||||
/// - Cleaning up old data
|
||||
/// - Generating reports
|
||||
/// - Syncing with external systems
|
||||
struct ScheduledTask {
|
||||
task_name: String,
|
||||
interval_secs: u64,
|
||||
}
|
||||
|
||||
impl Component for ScheduledTask {
|
||||
fn info(&self) -> ComponentInfo {
|
||||
format!("ScheduledTask:{}", self.task_name).into()
|
||||
}
|
||||
|
||||
async fn run(&self, cancellation: CancellationToken) -> Result<(), MadError> {
|
||||
println!(
|
||||
"[{}] Scheduled to run every {} seconds",
|
||||
self.info(),
|
||||
self.interval_secs
|
||||
);
|
||||
|
||||
let mut interval = interval(Duration::from_secs(self.interval_secs));
|
||||
let mut run_count = 0;
|
||||
|
||||
while !cancellation.is_cancelled() {
|
||||
tokio::select! {
|
||||
_ = cancellation.cancelled() => {
|
||||
println!("[{}] Scheduler stopping", self.info());
|
||||
break;
|
||||
}
|
||||
_ = interval.tick() => {
|
||||
run_count += 1;
|
||||
println!("[{}] Executing run #{}", self.info(), run_count);
|
||||
|
||||
// Simulate task execution
|
||||
tokio::time::sleep(Duration::from_millis(500)).await;
|
||||
|
||||
println!("[{}] Run #{} completed", self.info(), run_count);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> anyhow::Result<()> {
|
||||
println!("Starting multi-service application");
|
||||
println!("Press Ctrl+C to trigger graceful shutdown");
|
||||
println!("----------------------------------------");
|
||||
|
||||
// Build the application with multiple services
|
||||
Mad::builder()
|
||||
// Add a web server on port 8080
|
||||
.add(WebServer { port: 8080 })
|
||||
// Add another web server on port 8081 (e.g., admin interface)
|
||||
.add(WebServer { port: 8081 })
|
||||
// Add queue processors for different queues
|
||||
.add(QueueProcessor {
|
||||
queue_name: "orders".to_string(),
|
||||
})
|
||||
.add(QueueProcessor {
|
||||
queue_name: "notifications".to_string(),
|
||||
})
|
||||
// Add scheduled tasks
|
||||
.add(ScheduledTask {
|
||||
task_name: "cleanup".to_string(),
|
||||
interval_secs: 5,
|
||||
})
|
||||
.add(ScheduledTask {
|
||||
task_name: "report_generator".to_string(),
|
||||
interval_secs: 10,
|
||||
})
|
||||
// Add a monitoring component using a closure
|
||||
.add_fn(|cancel| async move {
|
||||
println!("[Monitor] Starting system monitor");
|
||||
let mut interval = interval(Duration::from_secs(15));
|
||||
|
||||
while !cancel.is_cancelled() {
|
||||
tokio::select! {
|
||||
_ = cancel.cancelled() => {
|
||||
println!("[Monitor] Stopping monitor");
|
||||
break;
|
||||
}
|
||||
_ = interval.tick() => {
|
||||
println!("[Monitor] All systems operational");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
})
|
||||
// Set graceful shutdown timeout to 3 seconds
|
||||
.cancellation(Some(Duration::from_secs(3)))
|
||||
// Run all components
|
||||
.run()
|
||||
.await?;
|
||||
|
||||
println!("----------------------------------------");
|
||||
println!("All services shut down successfully");
|
||||
|
||||
Ok(())
|
||||
}
|
||||
84
crates/mad/examples/nested_errors/main.rs
Normal file
84
crates/mad/examples/nested_errors/main.rs
Normal file
@@ -0,0 +1,84 @@
|
||||
use notmad::ComponentInfo;
|
||||
use tokio_util::sync::CancellationToken;
|
||||
|
||||
struct NestedErrorComponent {
|
||||
name: String,
|
||||
}
|
||||
|
||||
impl notmad::Component for NestedErrorComponent {
|
||||
fn info(&self) -> ComponentInfo {
|
||||
self.name.clone().into()
|
||||
}
|
||||
|
||||
async fn run(&self, _cancellation: CancellationToken) -> Result<(), notmad::MadError> {
|
||||
// Simulate a deeply nested error
|
||||
let io_error = std::io::Error::new(
|
||||
std::io::ErrorKind::PermissionDenied,
|
||||
"access denied to /etc/secret",
|
||||
);
|
||||
|
||||
Err(anyhow::Error::from(io_error)
|
||||
.context("failed to read configuration file")
|
||||
.context("unable to initialize database connection pool")
|
||||
.context(format!("component '{}' startup failed", self.name))
|
||||
.into())
|
||||
}
|
||||
}
|
||||
|
||||
struct AnotherFailingComponent;
|
||||
|
||||
impl notmad::Component for AnotherFailingComponent {
|
||||
fn info(&self) -> ComponentInfo {
|
||||
"another-component".into()
|
||||
}
|
||||
|
||||
async fn run(&self, _cancellation: CancellationToken) -> Result<(), notmad::MadError> {
|
||||
tokio::time::sleep(std::time::Duration::from_millis(100)).await;
|
||||
|
||||
Err(anyhow::anyhow!("network timeout after 30s")
|
||||
.context("failed to connect to external API")
|
||||
.context("service health check failed")
|
||||
.into())
|
||||
}
|
||||
}
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
tracing_subscriber::fmt()
|
||||
.with_env_filter("mad=debug")
|
||||
.init();
|
||||
|
||||
let result = notmad::Mad::builder()
|
||||
.add(NestedErrorComponent {
|
||||
name: "database-service".into(),
|
||||
})
|
||||
.add(AnotherFailingComponent)
|
||||
.run()
|
||||
.await;
|
||||
|
||||
match result {
|
||||
Ok(()) => println!("Success!"),
|
||||
Err(e) => {
|
||||
eprintln!("\n=== Error occurred ===");
|
||||
eprintln!("{}", e);
|
||||
|
||||
// Also demonstrate how to walk the error chain manually
|
||||
if let notmad::MadError::AggregateError(ref agg) = e {
|
||||
eprintln!("\n=== Detailed error chains ===");
|
||||
for (i, error) in agg.get_errors().iter().enumerate() {
|
||||
eprintln!("\nComponent {} error chain:", i + 1);
|
||||
if let notmad::MadError::Inner(inner) = error {
|
||||
for (j, cause) in inner.chain().enumerate() {
|
||||
eprintln!(" {}. {}", j + 1, cause);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if let notmad::MadError::Inner(ref inner) = e {
|
||||
eprintln!("\n=== Error chain ===");
|
||||
for (i, cause) in inner.chain().enumerate() {
|
||||
eprintln!(" {}. {}", i + 1, cause);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
66
crates/mad/examples/signals/main.rs
Normal file
66
crates/mad/examples/signals/main.rs
Normal file
@@ -0,0 +1,66 @@
|
||||
use notmad::ComponentInfo;
|
||||
use rand::Rng;
|
||||
use tokio_util::sync::CancellationToken;
|
||||
use tracing::Level;
|
||||
|
||||
struct WaitServer {}
|
||||
impl notmad::Component for WaitServer {
|
||||
fn info(&self) -> ComponentInfo {
|
||||
"WaitServer".into()
|
||||
}
|
||||
|
||||
async fn run(&self, _cancellation: CancellationToken) -> Result<(), notmad::MadError> {
|
||||
let millis_wait = rand::thread_rng().gen_range(500..3000);
|
||||
|
||||
tracing::debug!("waiting: {}ms", millis_wait);
|
||||
|
||||
// Simulates a server running for some time. Is normally supposed to be futures blocking indefinitely
|
||||
tokio::time::sleep(std::time::Duration::from_millis(millis_wait)).await;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
struct RespectCancel {}
|
||||
impl notmad::Component for RespectCancel {
|
||||
fn info(&self) -> ComponentInfo {
|
||||
"RespectCancel".into()
|
||||
}
|
||||
|
||||
async fn run(&self, cancellation: CancellationToken) -> Result<(), notmad::MadError> {
|
||||
cancellation.cancelled().await;
|
||||
tracing::debug!("stopping because job is cancelled");
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
struct NeverStopServer {}
|
||||
impl notmad::Component for NeverStopServer {
|
||||
fn info(&self) -> ComponentInfo {
|
||||
"NeverStopServer".into()
|
||||
}
|
||||
|
||||
async fn run(&self, _cancellation: CancellationToken) -> Result<(), notmad::MadError> {
|
||||
// Simulates a server running for some time. Is normally supposed to be futures blocking indefinitely
|
||||
tokio::time::sleep(std::time::Duration::from_millis(999999999)).await;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> anyhow::Result<()> {
|
||||
tracing_subscriber::fmt()
|
||||
.with_max_level(Level::TRACE)
|
||||
.init();
|
||||
|
||||
notmad::Mad::builder()
|
||||
.add(WaitServer {})
|
||||
.add(NeverStopServer {})
|
||||
.add(RespectCancel {})
|
||||
.run()
|
||||
.await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
79
crates/mad/src/waiter.rs
Normal file
79
crates/mad/src/waiter.rs
Normal file
@@ -0,0 +1,79 @@
|
||||
//! Waiter components for MAD.
|
||||
//!
|
||||
//! This module provides waiter components that simply wait for cancellation
|
||||
//! without performing any work. Useful for keeping the application alive
|
||||
//! or as placeholders in conditional component loading.
|
||||
|
||||
use tokio_util::sync::CancellationToken;
|
||||
|
||||
use crate::{Component, ComponentInfo, IntoComponent, MadError, SharedComponent};
|
||||
|
||||
/// A default waiter component that panics if run.
|
||||
///
|
||||
/// This is used internally as a placeholder that should never
|
||||
/// actually be executed.
|
||||
pub struct DefaultWaiter;
|
||||
impl Component for DefaultWaiter {
|
||||
async fn run(&self, _cancellation_token: CancellationToken) -> Result<(), MadError> {
|
||||
panic!("should never be called");
|
||||
}
|
||||
}
|
||||
|
||||
/// A wrapper component that waits for cancellation.
|
||||
///
|
||||
/// Instead of running the wrapped component's logic, this simply
|
||||
/// waits for the cancellation token. This is useful for conditionally
|
||||
/// disabling components while keeping the same structure.
|
||||
///
|
||||
/// # Example
|
||||
///
|
||||
/// ```rust,ignore
|
||||
/// use mad::Waiter;
|
||||
///
|
||||
/// // Instead of running the service, just wait
|
||||
/// let waiter = Waiter::new(service.into_component());
|
||||
/// ```
|
||||
pub struct Waiter {
|
||||
comp: SharedComponent,
|
||||
}
|
||||
|
||||
impl Default for Waiter {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
comp: DefaultWaiter {}.into_component(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Waiter {
|
||||
/// Creates a new waiter that wraps the given component.
|
||||
///
|
||||
/// The wrapped component's name will be used (prefixed with "waiter/"),
|
||||
/// but its run method will not be called.
|
||||
pub fn new(c: SharedComponent) -> Self {
|
||||
Self { comp: c }
|
||||
}
|
||||
}
|
||||
|
||||
impl Component for Waiter {
|
||||
/// Returns the name of the waiter, prefixed with "waiter/".
|
||||
///
|
||||
/// If the wrapped component has a name, it will be "waiter/{name}".
|
||||
/// Otherwise, returns "waiter".
|
||||
fn info(&self) -> ComponentInfo {
|
||||
match &self.comp.info().name {
|
||||
Some(name) => format!("waiter/{name}").into(),
|
||||
None => "waiter".into(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Waits for cancellation without performing any work.
|
||||
///
|
||||
/// This method simply waits for the cancellation token to be triggered,
|
||||
/// then returns successfully.
|
||||
async fn run(&self, cancellation_token: CancellationToken) -> Result<(), MadError> {
|
||||
cancellation_token.cancelled().await;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
@@ -1,18 +1,19 @@
|
||||
use async_trait::async_trait;
|
||||
use mad::{Component, Mad};
|
||||
use std::sync::Arc;
|
||||
|
||||
use notmad::{Component, ComponentInfo, Mad, MadError};
|
||||
use rand::Rng;
|
||||
use tokio::sync::Mutex;
|
||||
use tokio_util::sync::CancellationToken;
|
||||
use tracing_test::traced_test;
|
||||
|
||||
struct NeverEndingRun {}
|
||||
|
||||
#[async_trait]
|
||||
impl Component for NeverEndingRun {
|
||||
fn name(&self) -> Option<String> {
|
||||
Some("NeverEndingRun".into())
|
||||
fn info(&self) -> ComponentInfo {
|
||||
"NeverEndingRun".into()
|
||||
}
|
||||
|
||||
async fn run(&self, cancellation: CancellationToken) -> Result<(), mad::MadError> {
|
||||
async fn run(&self, _cancellation: CancellationToken) -> Result<(), notmad::MadError> {
|
||||
let millis_wait = rand::thread_rng().gen_range(50..1000);
|
||||
|
||||
tokio::time::sleep(std::time::Duration::from_millis(millis_wait)).await;
|
||||
@@ -86,3 +87,92 @@ async fn test_can_run_components() -> anyhow::Result<()> {
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
#[traced_test]
|
||||
async fn test_can_shutdown_gracefully() -> anyhow::Result<()> {
|
||||
let check = Arc::new(Mutex::new(None));
|
||||
|
||||
Mad::builder()
|
||||
.add_fn({
|
||||
let check = check.clone();
|
||||
|
||||
move |cancel| {
|
||||
let check = check.clone();
|
||||
|
||||
async move {
|
||||
let start = std::time::SystemTime::now();
|
||||
tracing::info!("waiting for cancel");
|
||||
cancel.cancelled().await;
|
||||
tracing::info!("submitting check");
|
||||
let mut check = check.lock().await;
|
||||
let elapsed = start.elapsed().expect("to be able to get elapsed");
|
||||
*check = Some(elapsed);
|
||||
tracing::info!("check submitted");
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
})
|
||||
.add_fn(|_| async move {
|
||||
tracing::info!("starting sleep");
|
||||
tokio::time::sleep(std::time::Duration::from_millis(100)).await;
|
||||
tracing::info!("sleep ended");
|
||||
|
||||
Ok(())
|
||||
})
|
||||
.run()
|
||||
.await?;
|
||||
|
||||
let check = check
|
||||
.lock()
|
||||
.await
|
||||
.expect("to be able to get a duration from cancel");
|
||||
|
||||
// We default wait 100 ms for graceful shutdown, and we explicitly wait 100ms in the sleep routine
|
||||
tracing::info!("check millis: {}", check.as_millis());
|
||||
assert!(check.as_millis() < 250);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
#[traced_test]
|
||||
async fn test_component_panics_shutdowns_cleanly() -> anyhow::Result<()> {
|
||||
let res = Mad::builder()
|
||||
.add_fn({
|
||||
move |_cancel| async move {
|
||||
panic!("my inner panic");
|
||||
}
|
||||
})
|
||||
.add_fn(|cancel| async move {
|
||||
cancel.cancelled().await;
|
||||
|
||||
Ok(())
|
||||
})
|
||||
.run()
|
||||
.await;
|
||||
|
||||
let err_content = res.unwrap_err().to_string();
|
||||
assert!(err_content.contains("component panicked"));
|
||||
assert!(err_content.contains("my inner panic"));
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_can_easily_transform_error() -> anyhow::Result<()> {
|
||||
fn fallible() -> anyhow::Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn inner() -> Result<(), MadError> {
|
||||
fallible()?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
inner()?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
# yaml-language-server: $schema=https://git.front.kjuulh.io/kjuulh/cuddle/raw/branch/main/schemas/base.json
|
||||
# yaml-language-server: $schema=https://git.kjuulh.io/kjuulh/cuddle/raw/branch/main/schemas/base.json
|
||||
|
||||
base: "git@git.front.kjuulh.io:kjuulh/cuddle-rust-lib-plan.git"
|
||||
base: "git@git.kjuulh.io:kjuulh/cuddle-rust-lib-plan.git"
|
||||
|
||||
vars:
|
||||
service: "mad"
|
||||
registry: kasperhermansen
|
||||
rust:
|
||||
publish: {}
|
||||
|
||||
please:
|
||||
project:
|
||||
@@ -12,6 +14,6 @@ please:
|
||||
repository: "mad"
|
||||
branch: main
|
||||
settings:
|
||||
api_url: "https://git.front.kjuulh.io"
|
||||
api_url: "https://git.kjuulh.io"
|
||||
actions:
|
||||
rust:
|
||||
|
||||
3
renovate.json
Normal file
3
renovate.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json"
|
||||
}
|
||||
Reference in New Issue
Block a user