public Push(Channel channel, string event_, JObject payload) { _channel = channel; _event = event_; _payload = payload; _receivedResp = null; _afterHook = null; _recHooks = new List <RecHook>(); _sent = false; }
public Push(Channel channel, string event_, JObject payload) { _channel = channel; _event = event_; _payload = payload; _receivedResp = null; _afterHook = null; _recHooks = new List<RecHook>(); _sent = false; }
public Push After(int timeoutMs, Action callback) { if (_afterHook != null) { //throw throw new Exception("only a single after hook can be applied to a push"); } var timer = new Timer(timeoutMs); if (_sent) { timer.Elapsed += (o, e) => callback(); timer.AutoReset = false; timer.Start();//.Enabled = true; } _afterHook = new AfterHook{ Ms = timeoutMs, Callback = callback, Timer = timer }; return this; }
public Push After(int timeoutMs, Action callback) { if (_afterHook != null) { //throw throw new Exception("only a single after hook can be applied to a push"); } var timer = new Timer(timeoutMs); if (_sent) { timer.Elapsed += (o, e) => callback(); timer.AutoReset = false; timer.Start();//.Enabled = true; } _afterHook = new AfterHook { Ms = timeoutMs, Callback = callback, Timer = timer }; return(this); }