rust #10
@ -4,6 +4,7 @@ use std::future::Future;
|
||||
use tokio::stream::StreamExt;
|
||||
use tokio::task::JoinHandle;
|
||||
|
||||
use crate::bot::BfxBot;
|
||||
use crate::pairs::PairStatus;
|
||||
use crate::positions::{Position, PositionProfitState, PositionState};
|
||||
use crate::BoxError;
|
||||
@ -96,6 +97,14 @@ impl EventDispatcher {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn call_signal_handlers(&self, signal: &SignalKind) {
|
||||
if let Some(functions) = self.signal_handlers.get(&signal) {
|
||||
for f in functions {
|
||||
f(signal);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn call_event_handlers(&self, event: &Event, status: &PairStatus) {
|
||||
if let Some(functions) = self.event_handlers.get(&event.kind()) {
|
||||
for f in functions {
|
||||
|
Loading…
Reference in New Issue
Block a user