public TemperatureSensor(IAppBus appBus, string name) { _name = name; _appBus = appBus; _appBus.Subscribe <DisableSensor>(this); _appBus.Subscribe <EnableSensor>(this); MakeSensorTick(); StartSensor(); }
private static QueuedHandler CreateMonitor(IAppBus bus, List <IStartable> startables, string monitorName) { var queueHandler = new QueuedHandler( new TimeToLiveHandler( new AlertMonitor( new NarrowingHandler <Message, TemperatureChanged> (new Monitor()), new HighTemperatureThreshold(120), bus) ), monitorName); startables.Add(queueHandler); return(queueHandler); }
public AlarmClock(IAppBus bus) { _bus = bus; _alarms = new ConcurrentQueue <SendMessageLater>(); _stopped = new AutoResetEvent(false); }
public AlertMonitor(IHandleMessage <Message> handler, IThreshold threshold, IAppBus bus) { _bus = bus; _threshold = threshold; _handler = handler; }
public ImportantMan(IAppBus bus) { _bus = bus; }