public Push Push(string event_, JObject payload, int timeout) { if (!_joinedOnce) //jfis - necessary? { throw new Exception($"tried to push '{event_}' to '{_topic}' before joining. Use channel.join() before pushing events"); } var pushEvent = new Push(this, event_, payload, timeout); if (CanPush()) { pushEvent.Send(); //jfis - send now if can } else { pushEvent.StartTimeout(); //jfis - if cant add to buffer, but what does start timeout do? _pushBuffer.Add(pushEvent); } return(pushEvent); }
public Push Push(string @event, object payload = null, TimeSpan?timeout = null) { if (!_joinedOnce) { throw new Exception( $"tried to push '{@event}' to '{Topic}' before joining." + " Use channel.join() before pushing events" ); } var pushEvent = new Push(this, @event, () => payload, timeout ?? _timeout); if (CanPush()) { pushEvent.Send(); } else { pushEvent.StartTimeout(); _pushBuffer.Add(pushEvent); } return(pushEvent); }
public Push Push(string event_, JObject payload, int timeout) { if (!_joinedOnce) //jfis - necessary? { throw new Exception($"tried to push '{event_}' to '{_topic}' before joining. Use channel.join() before pushing events"); } var pushEvent = new Push(this, event_, payload, timeout); if (CanPush()) { pushEvent.Send(); //jfis - send now if can } else { pushEvent.StartTimeout(); //jfis - if cant add to buffer, but what does start timeout do? _pushBuffer.Add(pushEvent); } return pushEvent; }