Trigger() приватный Метод

private Trigger ( string status, Newtonsoft.Json.Linq.JObject response ) : void
status string
response Newtonsoft.Json.Linq.JObject
Результат void
Пример #1
0
        public Push Leave(TimeSpan?timeout = null)
        {
            _rejoinTimer?.Reset();
            _joinPush.CancelTimeout();

            State = ChannelState.Leaving;

            void TriggerClose()
            {
                if (Socket.HasLogger())
                {
                    Socket.Log(LogLevel.Debug, "channel", $"leave {Topic}");
                }

                Trigger(Message.InBoundEvent.Close);
            }

            var leaveEvent = Message.OutBoundEvent.Leave.Serialized();
            var leavePush  = new Push(this, leaveEvent, null, timeout ?? _timeout);

            leavePush
            .Receive(ReplyStatus.Ok, _ => TriggerClose())
            .Receive(ReplyStatus.Timeout, _ => TriggerClose());
            leavePush.Send();

            if (!CanPush())
            {
                leavePush.Trigger(ReplyStatus.Ok);
            }

            return(leavePush);
        }
Пример #2
0
        public Push Leave(int timeout)
        {
            Action onClose = () =>
            {
                _socket.Log("channel", $"leave ${_topic}"); //jfis - seems odd to tie logs to socket

                Trigger(Phoenix.CHANNEL_EVENT_CLOSE);       //, "leave");
            };

            var leavePush = new Push(this, Phoenix.CHANNEL_EVENT_LEAVE, Phoenix.EMPTY_JS_OBJECT, timeout);

            leavePush
            .Receive("ok", (_) => onClose())
            .Receive("timeout", (_) => onClose());
            leavePush.Send();

            if (!CanPush()) //jfis - if cant push simulate ok
            {
                leavePush.Trigger("ok", Phoenix.EMPTY_JS_OBJECT);
            }

            return(leavePush);
        }
Пример #3
0
    public Push Leave(int timeout)
    {
      Action onClose = () =>
        {
          _socket.Log("channel", $"leave ${_topic}"); //jfis - seems odd to tie logs to socket

          Trigger(Phoenix.CHANNEL_EVENT_CLOSE);//, "leave");
        };

      var leavePush = new Push(this, Phoenix.CHANNEL_EVENT_LEAVE, Phoenix.EMPTY_JS_OBJECT, timeout);
      leavePush
        .Receive("ok", (_) => onClose())
        .Receive("timeout", (_) => onClose());
      leavePush.Send();

      if (!CanPush()) //jfis - if cant push simulate ok
      {
        leavePush.Trigger("ok", Phoenix.EMPTY_JS_OBJECT);
      }

      return leavePush;
    }