rust #10

Merged
peperunas merged 127 commits from rust into master 2021-02-18 09:42:16 +00:00
Showing only changes of commit 3171e054e0 - Show all commits

View File

@ -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 {