This commit is contained in:
Rob Ede 2021-01-29 20:47:22 +00:00
parent 4d22ed721d
commit df15ef40f6
No known key found for this signature in database
GPG Key ID: C2A3B36E841A91E6
2 changed files with 1 additions and 6 deletions

View File

@ -29,7 +29,6 @@ pub struct System {
worker_handle: WorkerHandle,
}
impl System {
/// Create a new system.
///
@ -151,7 +150,6 @@ pub struct SystemRunner {
impl SystemRunner {
/// Starts event loop and will return once [System] is [stopped](System::stop).
pub fn run(self) -> io::Result<()> {
let SystemRunner { rt, stop_rx, .. } = self;
// run loop

View File

@ -45,7 +45,6 @@ pub struct WorkerHandle {
sender: mpsc::UnboundedSender<WorkerCommand>,
}
impl WorkerHandle {
pub(crate) fn new(sender: mpsc::UnboundedSender<WorkerCommand>) -> Self {
Self { sender }
@ -103,6 +102,7 @@ impl Worker {
///
/// # Panics
/// Panics if a [System] is not registered on the current thread.
#[allow(clippy::new_without_default)]
pub fn new() -> Worker {
let id = COUNT.fetch_add(1, Ordering::Relaxed);
let name = format!("actix-rt:worker:{}", id);
@ -266,15 +266,12 @@ struct WorkerRunner {
rx: mpsc::UnboundedReceiver<WorkerCommand>,
}
impl Future for WorkerRunner {
type Output = ();
fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
// process all items currently buffered in channel
loop {
match ready!(Pin::new(&mut self.rx).poll_recv(cx)) {
// channel closed; no more messages can be received
None => return Poll::Ready(()),