Пример #1
0
        public void On(ISubscriptionContext context, PingEvent pingEvent)
        {
            count++;

            context.Logger.LogInformation($"Received: {pingEvent.Message}");

            context.ForkEvent(new PongEvent()
            {
                Message = $"Echo {pingEvent.Message}",
            });
        }
Пример #2
0
        public void On(ISubscriptionContext context, PongEvent pongEvent)
        {
            count++;

            context.Logger.LogInformation($"Received: {pongEvent.Message}");

            // Send a ping event unless we have reach max count
            if (count < SendFirstPing.NumberOfEvents)
            {
                context.ForkEvent(new PingEvent()
                {
                    Message = $"Ping #{count + 1}",
                });
            }
        }