예제 #1
0
        public IHttpActionResult PostReleaseNotification([NakedBody] string message = null, bool critical = false)
        {
            var notification = new ReleaseNotification {
                Critical = critical, Date = DateTimeOffset.UtcNow, Message = message
            };

            _messagePublisher.Publish(notification);
            return(Ok(notification));
        }
예제 #2
0
        public async Task <ActionResult <ReleaseNotification> > PostReleaseNotificationAsync(object body = null, bool critical = false)
        {
            var notification = new ReleaseNotification {
                Critical = critical, Date = SystemClock.UtcNow, Message = body as string
            };
            await _messagePublisher.PublishAsync(notification);

            return(Ok(notification));
        }
        public async Task <ActionResult <ReleaseNotification> > PostReleaseNotificationAsync(ValueFromBody <string> message, bool critical = false)
        {
            var notification = new ReleaseNotification {
                Critical = critical, Date = SystemClock.UtcNow, Message = message?.Value
            };
            await _messagePublisher.PublishAsync(notification);

            return(Ok(notification));
        }
예제 #4
0
        public async Task <IActionResult> PostReleaseNotificationAsync([FromBody] string message = null, [FromQuery] bool critical = false)
        {
            var notification = new ReleaseNotification {
                Critical = critical, Date = SystemClock.UtcNow, Message = message
            };
            await _messagePublisher.PublishAsync(notification);

            return(Ok(notification));
        }
예제 #5
0
 private Task OnReleaseNotificationAsync(ReleaseNotification notification, CancellationToken cancellationToken = default)
 {
     _logger.LogTrace("Sending release notification message: {Message}", notification.Message);
     return(TypedBroadcastAsync(notification));
 }
예제 #6
0
 private Task OnReleaseNotificationAsync(ReleaseNotification notification, CancellationToken cancellationToken = default(CancellationToken))
 {
     _logger.Trace(() => $"Sending release notification message: {notification.Message})");
     return(Context.Connection.TypedBroadcastAsync(notification));
 }
예제 #7
0
 private Task OnReleaseNotificationAsync(ReleaseNotification notification, CancellationToken cancellationToken = default(CancellationToken))
 {
     return(Context.Connection.TypedBroadcastAsync(notification));
 }
예제 #8
0
 private void OnReleaseNotification(ReleaseNotification notification)
 {
     try {
         Clients.All.releaseNotification(notification);
     } catch (NullReferenceException) {} // TODO: Remove this when SignalR bug is fixed.
 }