fix(service): Switch from flume to postage to fix out-of-order communication
This commit is contained in:
parent
490c6a6e8b
commit
8b4fbf441f
12 changed files with 156 additions and 208 deletions
|
|
@ -8,7 +8,8 @@ pub use self::help::HelpPlugin;
|
|||
|
||||
use crate::{PluginHelp, Request};
|
||||
use async_trait::async_trait;
|
||||
use flume::{Receiver, Sender};
|
||||
use postage::mpsc::{Receiver, Sender};
|
||||
use postage::prelude::*;
|
||||
use regex::Regex;
|
||||
|
||||
#[async_trait]
|
||||
|
|
@ -31,8 +32,8 @@ where
|
|||
|
||||
async fn quit(&mut self, id: u32);
|
||||
|
||||
async fn run(&mut self, rx: Receiver<Request>) {
|
||||
while let Ok(request) = rx.recv_async().await {
|
||||
async fn run(&mut self, mut rx: Receiver<Request>) {
|
||||
while let Some(request) = rx.recv().await {
|
||||
tracing::event!(
|
||||
tracing::Level::DEBUG,
|
||||
"{}: received {:?}",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue