public ThreadCoreHandler(IEntry core) { if (core == null) { throw new ArgumentNullException(nameof(core)); } _Core = core; _RequesterHandlers = new Updater(); _Spin = new PowerRegulator(); _AutoPowerRegulator = new AutoPowerRegulator(_Spin); _Binders = new Queue <ISoulBinder>(); }
internal void Run(object obj) { var are = (AutoResetEvent)obj; var powerRegulator = new PowerRegulator(10); var autoPowerRegulator = new AutoPowerRegulator(powerRegulator); while (_HasValue == false) { autoPowerRegulator.Operate(); } are.Set(); }
public ThreadSocketHandler(int port, ThreadCoreHandler core_handler, IProtocol protocol, IListenable server) { _CoreHandler = core_handler; _Protocol = protocol; _Port = port; _Sockets = new Queue <IPeer>(); _Peers = new PeerSet(); _Spin = new PowerRegulator(); _AutoPowerRegulator = new AutoPowerRegulator(_Spin); _Server = server; }
public AutoPowerRegulator(PowerRegulator power_regulator) { _Counter = new TimeCounter(); _PreviousTicks = _Counter.Ticks; _PowerRegulator = power_regulator; }
public AutoPowerRegulator(PowerRegulator power_regulator) { _Counter = new TimeCounter(); _PreviousTicks = _Counter.Ticks; _PowerRegulator = power_regulator; }