public Simulator(IPredictionMachine predictionMachine) { lock (_predictionMachineUpdateLock) { _predictionMachine = predictionMachine; } }
public void UpdatePredictionMachine(IPredictionMachine predictionMachine) { lock (_predictionMachineUpdateLock) { _predictionMachine = predictionMachine; } }
private static void HandleNewPredictionMachine(EventstoreEvent incomingEvent) { try { IPredictionMachine newPredictionMachine = SerializationHelper.DeserializeBot(incomingEvent.Data); _simulator.UpdatePredictionMachine(newPredictionMachine); OutputWriter.WriteLine(ConsoleColor.Cyan, "Got new PredictionMachine, updated!"); PreloadPreviousTickersToWarmUp(EventstoreHandler); } catch (Exception ex) { OutputWriter.WriteLine(ConsoleColor.Red, $"Could not update prediction machine :( {ex.Message}"); } }