16 Commits

Author SHA1 Message Date
Michal 'vorner' Vaner 13f201c482 Release 2022-01-08 12:30:13 +01:00
Michal 'vorner' Vaner da0b7ce3aa Async crates improvements
* Make the streams for _all_ variants of SignalsInfo
* Remove unnecessary parts of examples
2022-01-04 21:12:10 +01:00
Michal 'vorner' Vaner 2e6f916113 Fix versions 2021-05-28 21:07:17 +02:00
Victor d112bacb7e Bump versions 2021-05-20 11:18:14 +00:00
Michal 'vorner' Vaner c86563b1cf _-async-std-v0.2.1 2021-01-31 11:54:21 +01:00
Ben Aaron Goldberg 30881681e6 signal-hook-async-std: Switch to using async-io + futures-lite
Switch to async-std's underlying async-io and futures-lite crates for
better compatibility with smol and using fewer dependencies in general.
Doing this also does not substantially changing the code, which is a
plus.
2021-01-29 03:58:28 -05:00
Michal 'vorner' Vaner 473fccf421 Fold the signal-hook-sys inside the main signal-hook
To avoid problems with extra dependency, compatibility, etc.
2021-01-02 18:43:25 +01:00
Michal 'vorner' Vaner 47e1f2f63e Prepare release of 0.3.0 and related 2020-12-21 20:42:46 +01:00
Michal 'vorner' Vaner 0f813da37f Raise and abort 2020-12-18 21:32:36 +01:00
Michal 'vorner' Vaner 502c938f7f Move the signal constants into a submodule
So we don't pollute the root with this stuff.
Also including the same set of signals under it's own submodule of the
submodule, so it can be mass-imported, but not pollute with other
constants.
2020-12-17 21:43:41 +01:00
Michal 'vorner' Vaner d3c4150873 Merge pull request #72 from ooesili/async-std-no-futures
Remove futures dependency from async-std adapter
2020-12-17 20:49:32 +01:00
Wesley Merkel 19e271ec47 Remove futures dependency from async-std adapter
The `async-std` crate does not actually depend on the `futures` crate
for the types `Context`, `Poll`, `AsyncRead` (simply called `Read` in
`async-std`), `Stream`, and `StreamExt`. It instead relies on the
versions of `Context` and `Poll` from the Rust standard library, which
it re-exports, and provides its own definition of the `Read`, `Stream`,
and `StreamExt` traits. For this reason users of the
`signal-hook-async-std` crate are unlikely to depend on the `futures`
crate themselves, making this crate's dependency on `futures`
unnecessary.

This commit replaces these types with the versions from `async-std` and
removes the `futures` dependency from the `signal-hook-async-std` crate.

In another project I am working on that uses `signal-hook` and
`async-std`, this change removed the following 10 crates from my
dependency list:

- futures
- futures-executor
- futures-macro
- futures-sink
- futures-task
- futures-util
- pin-project
- pin-project-internal
- proc-macro-hack
- proc-macro-nested
2020-12-13 23:55:16 -06:00
Thomas Himmelstoss 4d5fa481bf Do not consume the Signals instance in the forever method
Instead only borrow the instance mutable in the mentioned method.
But the adapter crates still require a SignalIterator which owns the
SignalDelivery instance. Both requirements can be met by using a generic
type in the SignalIterator struct and rely onto a BorrowMut parameter
constraint in its implementation.
2020-12-04 15:17:09 +01:00
Michal 'vorner' Vaner f86b87b9b7 Remove type parameters from iterator::backend::Handle
It doesn't need it for the user to interact with it, so it gets hidden
behind a trait object.
2020-11-22 16:04:17 +01:00
Michal 'vorner' Vaner d28f9613d7 Parametrize all iterators with the Exfiltrator trait
This goes through the helper async crates too. Everything can now
provide different output types (though the only exfiltrator implemented
is still the SignalOnly, that preserves the original behaviour of
returning just the signal numbers).
2020-11-22 16:04:17 +01:00
Thomas Himmelstoss 241632d6f6 Implement async-std 1.0 support
The implementation provides a wrapper using a async-std UnixStream as
the self pipe. The wrapper acts as an asynchronous stream of signal
numbers.
2020-11-22 11:38:16 +01:00