Пример #1
0
        public Push Push(string event_, JObject payload = null)
        {
            if (!_alreadyJoinedOnce)
            {
                throw new Exception(string.Format("tried to push {0} to {1} before joining. Use Channel.Join() before pushing events", event_, payload));
            }

            var pushEvent = new Push(this, event_, payload);

            if (CanPush())
            {
                pushEvent.Send();
            }
            else
            {
                _pushBuffer.Add(pushEvent);
            }

            return(pushEvent);
        }
Пример #2
0
 private void SendJoin()
 {
     _state = ChannelState.Joining;
     _joinPush.Send();
 }
Пример #3
0
        public Push Push(string event_, JObject payload = null)
        {
            if (!_alreadyJoinedOnce)
            {
                throw new Exception(string.Format("tried to push {0} to {1} before joining. Use Channel.Join() before pushing events", event_, payload));
            }

            var pushEvent = new Push(this, event_, payload);

            if (CanPush())
            {
                pushEvent.Send();
            }
            else
            {
                _pushBuffer.Add(pushEvent);
            }

            return pushEvent;
        }