Ejemplo n.º 1
0
        private async Task BeforePublishEventEntityChanged(object sender, BeforePublishEntityChangedEventArgs <PersistentEvent> args)
        {
            args.Cancel = await GetNumberOfListeners(args.Message).AnyContext() == 0;

            if (args.Cancel && _logger.IsEnabled(LogLevel.Trace))
            {
                _logger.LogTrace("Cancelled Persistent Event Entity Changed Message: {@Message}", args.Message);
            }
        }
Ejemplo n.º 2
0
        private async Task BeforePublishStackEntityChanged(object sender, BeforePublishEntityChangedEventArgs <Stack> args)
        {
            args.Cancel = await GetNumberOfListeners(args.Message).AnyContext() == 0;

            if (args.Cancel)
            {
                _logger.LogTrace("Cancelled Stack Entity Changed Message: {@Message}", args.Message);
            }
        }