mirror of https://github.com/fafhrd91/actix-net
fix doc comments
This commit is contained in:
parent
a19cc228aa
commit
1033f5aa67
|
@ -244,7 +244,6 @@ impl Accept {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_ => {
|
_ => {
|
||||||
println!("polling event");
|
|
||||||
let token = usize::from(token);
|
let token = usize::from(token);
|
||||||
self.accept(token);
|
self.accept(token);
|
||||||
}
|
}
|
||||||
|
@ -342,8 +341,8 @@ impl Accept {
|
||||||
let next = self.next();
|
let next = self.next();
|
||||||
match next.send(conn) {
|
match next.send(conn) {
|
||||||
Ok(_) => {
|
Ok(_) => {
|
||||||
// Increment counter of WorkerHandle.
|
// Increment counter of worker handle.
|
||||||
// Set worker to unavailable with it hit max (Return false).
|
// Set it to unavailable with it hit max (Return false).
|
||||||
if !next.incr_counter() {
|
if !next.incr_counter() {
|
||||||
let idx = next.idx();
|
let idx = next.idx();
|
||||||
self.avail.set_available(idx, false);
|
self.avail.set_available(idx, false);
|
||||||
|
@ -357,7 +356,7 @@ impl Accept {
|
||||||
self.remove_next();
|
self.remove_next();
|
||||||
|
|
||||||
if self.handles.is_empty() {
|
if self.handles.is_empty() {
|
||||||
error!("No workers");
|
error!("No worker available. Dropping connection.");
|
||||||
// All workers are gone and Conn is nowhere to be sent.
|
// All workers are gone and Conn is nowhere to be sent.
|
||||||
// Treat this situation as Ok and drop Conn.
|
// Treat this situation as Ok and drop Conn.
|
||||||
return Ok(());
|
return Ok(());
|
||||||
|
|
|
@ -12,7 +12,7 @@ use crate::worker::WorkerHandleAccept;
|
||||||
/// Waker token for `mio::Poll` instance.
|
/// Waker token for `mio::Poll` instance.
|
||||||
pub(crate) const WAKER_TOKEN: Token = Token(usize::MAX);
|
pub(crate) const WAKER_TOKEN: Token = Token(usize::MAX);
|
||||||
|
|
||||||
/// Types of interests we would look into when `Accept`'s `Poll` is waked up by waker.
|
/// Types of interests we would look into when `Accept`'s `Poll` is waked up by WakerTx.
|
||||||
///
|
///
|
||||||
/// These interests should not be confused with `mio::Interest` and mostly not I/O related
|
/// These interests should not be confused with `mio::Interest` and mostly not I/O related
|
||||||
pub(crate) enum WakerInterest {
|
pub(crate) enum WakerInterest {
|
||||||
|
@ -55,11 +55,11 @@ impl Clone for WakerTx {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl WakerTx {
|
impl WakerTx {
|
||||||
/// Send WakerInterest through channel and panic on error(shutdown).
|
|
||||||
pub(crate) fn wake(&self, interest: WakerInterest) {
|
pub(crate) fn wake(&self, interest: WakerInterest) {
|
||||||
// ingore result. tokio UnboundedSender only fail when the channel
|
// ingore result. tokio UnboundedSender::send only fail when the
|
||||||
// is closed. In that case the Accept thread is gone and no further
|
// channel is closed.
|
||||||
// wake up is needed/possible.
|
// In that case the Accept thread is gone and no further wake up
|
||||||
|
// is needed/possible.
|
||||||
let _ = self.0.send(interest);
|
let _ = self.0.send(interest);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -82,7 +82,7 @@ impl DerefMut for WakerRx {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn from_registry(registry: &Registry) -> std::io::Result<Waker> {
|
pub(crate) fn from_registry(registry: &Registry) -> std::io::Result<Waker> {
|
||||||
mio::Waker::new(registry, WAKER_TOKEN).map(|waker| Arc::new(_Waker(waker)).into())
|
mio::Waker::new(registry, WAKER_TOKEN).map(|waker| Waker::from(Arc::new(_Waker(waker))))
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn waker_channel() -> (WakerTx, WakerRx) {
|
pub(crate) fn waker_channel() -> (WakerTx, WakerRx) {
|
||||||
|
|
Loading…
Reference in New Issue