示例#1
0
        public Task <bool> Any(Action <PublishedMessageFilter> apply = default, CancellationToken cancellationToken = default)
        {
            var messageFilter = new PublishedMessageFilter();

            apply?.Invoke(messageFilter);

            return(Any(message => messageFilter.Any(message), cancellationToken));
        }
示例#2
0
        public IAsyncEnumerable <IPublishedMessage> SelectAsync(Action <PublishedMessageFilter> apply, CancellationToken cancellationToken = default)
        {
            var messageFilter = new PublishedMessageFilter();

            apply?.Invoke(messageFilter);

            return(SelectAsync(message => messageFilter.Any(message), cancellationToken));
        }
示例#3
0
        public Task <bool> Any <T>(FilterDelegate <IPublishedMessage <T> > filter, CancellationToken cancellationToken = default)
            where T : class
        {
            var messageFilter = new PublishedMessageFilter();

            messageFilter.Includes.Add(filter);

            return(Any(message => messageFilter.Any(message), cancellationToken));
        }
示例#4
0
        public IAsyncEnumerable <IPublishedMessage <T> > SelectAsync <T>(FilterDelegate <IPublishedMessage <T> > filter, CancellationToken cancellationToken = default)
            where T : class
        {
            var messageFilter = new PublishedMessageFilter();

            messageFilter.Includes.Add(filter);

            return(SelectAsync(message => messageFilter.Any(message), cancellationToken).Select <IPublishedMessage, IPublishedMessage <T> >());
        }