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;
}