public static MasterDeviceDispatcher Create(IReadOnlyCollection <NandakaDevice> slaveDevices, IDeviceUpdatePolicy updatePolicy, ILog log) { var updaterLog = new PrefixLog(log, "[Dispatcher]"); return(new MasterDeviceDispatcher(slaveDevices, updatePolicy, updaterLog)); }
public static MasterThread Create(IReadOnlyCollection <NandakaDevice> slaveDevices, IProtocol protocol, IDeviceUpdatePolicy updatePolicy, ILog log) { var threadLog = new PrefixLog(log, "[Master]"); var dispatcher = MasterDeviceDispatcher.Create(slaveDevices, updatePolicy, threadLog); return(new MasterThread(dispatcher, protocol, threadLog)); }
private MasterDeviceDispatcher(IReadOnlyCollection <NandakaDevice> slaveDevices, IDeviceUpdatePolicy updatePolicy, ILog log) { SlaveDevices = slaveDevices; _updatePolicy = updatePolicy; _log = log; }
public void Start(IProtocol protocol, IDeviceUpdatePolicy updatePolicy) { _log.AppendMessage(LogMessageType.Info, "Starting Master thread"); _thread = MasterThread.Create(SlaveDevices, protocol, updatePolicy, _log); _thread.StartRoutine(); }