use crate::{
error::DataError,
event::MarketEvent,
subscription::{Map, SubscriptionKind},
};
use rustrade_integration::{Transformer, protocol::websocket::WsMessage};
use std::future::Future;
use tokio::sync::mpsc;
pub mod stateless;
pub trait ExchangeTransformer<Exchange, InstrumentKey, Kind>
where
Self: Transformer<Output = MarketEvent<InstrumentKey, Kind::Event>, Error = DataError> + Sized,
Kind: SubscriptionKind,
{
fn init(
instrument_map: Map<InstrumentKey>,
initial_snapshots: &[MarketEvent<InstrumentKey, Kind::Event>],
ws_sink_tx: mpsc::UnboundedSender<WsMessage>,
) -> impl Future<Output = Result<Self, DataError>> + Send
where
InstrumentKey: Sync,
Kind::Event: Sync;
}