-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
signal: misc improvements #1243
Comments
Hey @carllerche thanks for opening this, you've pretty much hit on the major API changes I was intending we update as part of the next breaking milestone (the lack of polish is largely leftover remains from older APIs which couldn't get fixed without breaking changes).
I'd also like to unify the Windows/Unix implementation differences (currently tracked in #1000). One other idea I wanted to explore is improving the wake performance of signals. Right now all signals get woken each time due to past limitations where dropping the runtime would leak futures. Given this has been fixed I think it's worth revisiting as well. |
Assigning this to myself, but for anyone interested in tackling any of this, feel free to ping me for questions/help or cc me on any opened PRs! |
@ipetkov cool! Also, just to be explicit. All the points in this issue are up for discussion. I just opened the issue with anything I thought of skimming the code. If you think they are all good ideas, then great 👍 |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I am proposing that we only export Thoughts from @carllerche or anyone else? |
As a user I'd like to be able to catch and respond to a number of different signal types. I know that most of all of them are Unix specific, but I have an interest in being able to use this for general purpose signal catching. |
@naftulikay signals are very much a Unix-specific concept. What do you mean by general purpose signal catching? You can still register interest for any arbitrary Unix signal by using the platform specific APIs defined in the |
I'm writing a process supervisor which needs to listen for term, quit, and chld signals. Being able to do that with Tokio is great for me as a user, as I get all the benefits of Tokio. Why are process signals in tokio::net? |
We decided to consolidate various crates together to make maintaining and releasing crates more streamlined (see #1264 for more info). |
My apologies: I'm looking through the 0.1 and 0.2 docs and not seeing anything in tokio::net. I'm mainly interested in understanding how the new API will work. |
The internals will be the same, they're just migrating to where they're defined! |
@carllerche yep that makes sense, I'll take a pass on updating the APIs to remove types where possible, and switch to using a dedicated constructor function rather than |
I believe all outstanding issues here have been resolved so I'm going to close this! |
Tracking misc smaller improvements to
tokio-signal
.This issue is to be closed once there are no remaining breaking changes to make or remaining breaking changes are tracked in separate issues.
Update to
std::future
Polish
crate::ctrl_c{,_with_handle}
with aCtrlC
struct withCtrlC::{new, with_handle}
methods (signal: Replacectrl_c
with aCtrlC
struct #1273)crate::windows::Event
withcrate::CtrlC
andcrate::windows::CtrlBreak
(signal: replacewindows::Event
withwindows::CtrlBreak
#1331)crate::unix::Signal::new
to accept a newSignalType
enum (signal: Add SignalKind for registering signals more easily #1430)signal_hook
)Raw(c_int)
variant to allow specifying a signal using the libc definition (this unblocks anyone who wants to work with an OS specific signal which isn't defined in theSignalType
enum)tokio_signal
should be the only crate that ever needs to match on the types)libc
re-exports in favor ofSignalType
(signal: Add SignalKind for registering signals more easily #1430)crate::unix::Signal
to return()
instead of the signum (signal: change unix::Signal to return () instead of signum #1330)SignalType
used during registration in case the caller wishes to listen to multiple signal streams and join them viafutures::select
Signal::new(sig_type).map(|()| sig_type)
if they wish to get this functionality, which keeps our API surface smallerCtrlC
/CtrlBreak
/Signal
regular streams (notIoStream
) since once they're up and registered there are not errors that are raisedio::Result<Self>
instead of needing an intermediate init future (signal: Change constructors to return a result instead of lazy future #1340)IoFuture
/IoStream
definitionsSignalKind
and its associated methods (signal: rename SignalKind methods #1457)Re-export
tokio_signal::CtrlC
astokio::signal::CtrlC
(Expose signal from net as a feature #1491)The text was updated successfully, but these errors were encountered: