protected void OnCommandReceived(ServerEventCommand e)
        {
            if (log.IsDebugEnabled)
            {
                log.Debug($"[SSE-CLIENT] OnCommandReceived: ({e.GetType().Name}) #{e.EventId} on #{ConnectionDisplayName} ({string.Join(", ", Channels)})");
            }

            var hold = commandTcs;

            commandTcs = new TaskCompletionSource <ServerEventCommand>();

            OnCommand?.Invoke(e);

            hold.SetResult(e);
        }
Beispiel #2
0
        protected void OnCommandReceived(ServerEventCommand e)
        {
            if (log.IsDebugEnabled)
            {
                log.DebugFormat("[SSE-CLIENT] OnCommandReceived: ({0}) #{1} on #{2} ({3})", e.GetType().Name, e.EventId, ConnectionDisplayName, string.Join(", ", Channels));
            }

            var hold = commandTcs;

            commandTcs = new TaskCompletionSource <ServerEventCommand>();

            if (OnCommand != null)
            {
                OnCommand(e);
            }

            hold.SetResult(e);
        }
Beispiel #3
0
        protected void OnCommandReceived(ServerEventCommand e)
        {
            if (log.IsDebugEnabled)
            {
                log.DebugFormat("OnCommandReceived: {0} on #{1}", e.EventId, ConnectionInfo.DisplayName);
            }

            var hold = commandTcs;

            commandTcs = new TaskCompletionSource <ServerEventCommand>();

            if (OnCommand != null)
            {
                OnCommand(e);
            }

            hold.SetResult(e);
        }