Skip to content

Commit

Permalink
merge base/rel & rel/base orderbook streamers
Browse files Browse the repository at this point in the history
into one streamer for their topic
  • Loading branch information
mariocynicys committed Sep 8, 2024
1 parent 588c85c commit 8d24afe
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions mm2src/mm2_main/src/lp_ordermatch/orderbook_events.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use super::{subscribe_to_orderbook_topic, OrderbookP2PItem};
use super::{orderbook_topic_from_base_rel, subscribe_to_orderbook_topic, OrderbookP2PItem};
use coins::{is_wallet_only_ticker, lp_coinfind};
use mm2_core::mm_ctx::MmArc;
use mm2_event_stream::{Broadcaster, Event, EventStreamer, StreamHandlerInput};
Expand All @@ -17,7 +17,9 @@ pub struct OrderbookStreamer {
impl OrderbookStreamer {
pub fn new(ctx: MmArc, base: String, rel: String) -> Self { Self { ctx, base, rel } }

pub fn derive_streamer_id(base: &str, rel: &str) -> String { format!("ORDERBOOK_UPDATE/{base}:{rel}") }
pub fn derive_streamer_id(base: &str, rel: &str) -> String {
format!("ORDERBOOK_UPDATE/{}", orderbook_topic_from_base_rel(base, rel))
}
}

#[derive(Serialize)]
Expand Down

0 comments on commit 8d24afe

Please sign in to comment.