use std::{io, sync::mpsc::Sender};

#[cfg(unix)]
pub mod unix_socket_listener;

#[cfg(unix)]
pub use unix_socket_listener::UnixSocketListener as Listener;

use crate::player::{PlayerError, PlayerEvent, PlayerRequest};

pub trait IpcListener {
    fn open(engine_tx: Sender<PlayerRequest>) -> Result<Sender<PlayerEvent>, PlayerError>;
    fn run(self) -> io::Result<()>;
}
