Example #1
0
        public async Task SendMessageAsync(string subscriberId, string message)
        {
            // Add subscriber
            var sessionId = Guid.NewGuid().ToString();
            await _notify.AddSubscriberAsync(subscriberId, sessionId);

            // Simulate long-running task
            var timer = new Timer(async state =>
            {
                await _notify.PublishAsync(sessionId, message);
            }, message, DelaySeconds * 1000, Timeout.Infinite);
        }