コード例 #1
0
        /// <summary>
        /// Use <see cref="IMessageSubscribeFactory"/> create a new subscriber,
        /// </summary>
        /// <param name="options"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        public async Task <IMessageSubscriber> CreateAsync(MessageSubscriberOptions options, CancellationToken cancellationToken = default)
        {
            var subscriber = await _subscribeFactory.CreateSubscriberAsync(options, cancellationToken);

            _subscriberDic.TryAdd(subscriber, options);

            return(subscriber);
        }
コード例 #2
0
        public Task <IMessageSubscriber> CreateSubscriberAsync(MessageSubscriberOptions options, CancellationToken cancellationToken = default)
        {
            _logger.LogInformation($"Message Bus create a subscriber.");

            return(_subscribeManager.CreateAsync(options, cancellationToken));
        }