use crate::endpoint::Endpoint; use async_trait::async_trait; use tokio::sync::{mpsc,oneshot}; use std::sync::Arc; use eyre::Result; use crate::event::{EventKind,Event}; pub struct IrcEndpoint { } #[async_trait] impl Endpoint for IrcEndpoint { fn name(&self) -> String { "test irc_endpoint".into() } fn is_active(&self) -> bool { true } async fn listen(self: Arc, success_status_send: oneshot::Sender>, event_receiver: mpsc::Sender) { success_status_send.send(Ok(())); let (s,r) = oneshot::channel(); event_receiver.send( Event { kind: EventKind::Message, result_receiver: r, }).await; } }