コード例 #1
0
        public static IEventBusBuilder PublishToAmazonSns(this IEventBusBuilder builder,
                                                          Action <AmazonSnsEventPublisherOptions> setupActions)
        {
            builder.Services
            .Configure(setupActions)
            ;

            return(builder
                   .AddEventPublisher <AmazonSnsEventPublisher>());
        }
コード例 #2
0
        public static IEventBusBuilder AddInMemoryEventBus(this IEventBusBuilder builder, Action <IEventBusSubscriber> subscribeAction)
        {
            if (builder == null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

            var subscriber = new InMemoryEventBusSubscriber(builder.Services);

            subscribeAction?.Invoke(subscriber);

            return(builder.AddEventPublisher <InMemoryEventBus>());
        }