当前位置: 首页>>代码示例>>C#>>正文


C# IInMemoryReceiveEndpointConfigurator类代码示例

本文整理汇总了C#中IInMemoryReceiveEndpointConfigurator的典型用法代码示例。如果您正苦于以下问题:C# IInMemoryReceiveEndpointConfigurator类的具体用法?C# IInMemoryReceiveEndpointConfigurator怎么用?C# IInMemoryReceiveEndpointConfigurator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IInMemoryReceiveEndpointConfigurator类属于命名空间,在下文中一共展示了IInMemoryReceiveEndpointConfigurator类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ConfigureInputQueueEndpoint

 protected override void ConfigureInputQueueEndpoint(IInMemoryReceiveEndpointConfigurator configurator)
 {
     Handler<PingMessage>(configurator, async context =>
     {
         throw new SerializationException("This is fine, forcing death");
     });
 }
开发者ID:MassTransit,项目名称:MassTransit,代码行数:7,代码来源:ErrorQueue_Specs.cs

示例2: ConfigureInputQueueEndpoint

        protected override void ConfigureInputQueueEndpoint(IInMemoryReceiveEndpointConfigurator configurator)
        {
            _consumer = new OneMessageConsumer(GetTask<MessageA>());


            configurator.Consumer(() => _consumer);
        }
开发者ID:kotvisbj,项目名称:MassTransit,代码行数:7,代码来源:InstanceSubscription_Specs.cs

示例3: ConfigureInputQueueEndpoint

 protected override void ConfigureInputQueueEndpoint(IInMemoryReceiveEndpointConfigurator configurator)
 {
     configurator.Handler<PingMessage>(async context =>
     {
         await context.RespondAsync(new PongMessage(context.Message.CorrelationId));
     });
 }
开发者ID:kotvisbj,项目名称:MassTransit,代码行数:7,代码来源:InMemorySpeed_Specs.cs

示例4: ConfigureInputQueueEndpoint

        protected override void ConfigureInputQueueEndpoint(IInMemoryReceiveEndpointConfigurator configurator)
        {
            _bookingRequestSagaRepository = new InMemorySagaRepository<BookingRequestState>();
            _bookingRequestStateMachine = new BookingRequestStateMachine();

            configurator.StateMachineSaga(_bookingRequestStateMachine, _bookingRequestSagaRepository);
        }
开发者ID:rmichela,项目名称:Sample-Booking,代码行数:7,代码来源:BookingRequestTracking_Specs.cs

示例5: ConfigureInputQueueEndpoint

        protected override void ConfigureInputQueueEndpoint(IInMemoryReceiveEndpointConfigurator configurator)
        {
            _count = 0;

            _received = GetTask<ConsumeContext<PingMessage>>();

            configurator.Handler<PingMessage>(async context =>
            {
                if (_timer == null)
                    _timer = Stopwatch.StartNew();

                if (_count++ < 2)
                {
                    Console.WriteLine("{0} now is not a good time", DateTime.UtcNow);
                    throw new IntentionalTestException("I'm so not ready for this jelly.");
                }

                _timer.Stop();

                Console.WriteLine("{0} okay, now is good (retried {1} times)", DateTime.UtcNow, context.Headers.Get("MT-Redelivery-Count", default(int?)));

                // okay, ready.
                _receivedTimeSpan = _timer.Elapsed;
                _received.TrySetResult(context);
            }, x => x.UseScheduledRedelivery(Retry.Intervals(1000,2000)));
        }
开发者ID:kotvisbj,项目名称:MassTransit,代码行数:26,代码来源:DelayRetry_Specs.cs

示例6: ConfigureInputQueueEndpoint

        protected override void ConfigureInputQueueEndpoint(IInMemoryReceiveEndpointConfigurator configurator)
        {
            _observer = GetObserver<A>();

            configurator.Observer(_observer);

            configurator.Observer(Observer.Create<ConsumeContext<A>>(m => Console.WriteLine(m.Message.Name)));
        }
开发者ID:kotvisbj,项目名称:MassTransit,代码行数:8,代码来源:Factory_Specs.cs

示例7: ConfigureInputQueueEndpoint

        protected override void ConfigureInputQueueEndpoint(IInMemoryReceiveEndpointConfigurator configurator)
        {
            _completed = Handled<RoutingSlipCompleted>(configurator);

            var fetchAvatarActivity = GetActivityContext<FetchAvatarActivity>();

            _activityCompleted = Handled<RoutingSlipActivityCompleted>(configurator, context => context.Message.ActivityName.Equals(fetchAvatarActivity.Name));
        }
开发者ID:rmichela,项目名称:Sample-Booking,代码行数:8,代码来源:FetchAvatar_Specs.cs

示例8: ConfigureInputQueueEndpoint

        protected override void ConfigureInputQueueEndpoint(IInMemoryReceiveEndpointConfigurator configurator)
        {
            base.ConfigureInputQueueEndpoint(configurator);

            var testActivity = GetActivityContext<TestActivity>();

            _handled = Handled<RoutingSlipActivityCompleted>(configurator, x => x.Message.ActivityName == testActivity.Name);
        }
开发者ID:MassTransit,项目名称:MassTransit,代码行数:8,代码来源:ItinerarySubscription_Specs.cs

示例9: ConfigureInputQueueEndpoint

        protected override void ConfigureInputQueueEndpoint(IInMemoryReceiveEndpointConfigurator configurator)
        {
            // TODO would be nice to support serialization per receiving endpoint

            // configurator.UseJsonSerializer();

            _requestReceived = Handler<A>(configurator, context => context.RespondAsync(new B()));
        }
开发者ID:kotvisbj,项目名称:MassTransit,代码行数:8,代码来源:SerializationSupport_Specs.cs

示例10: ConfigureInputQueueEndpoint

        protected override void ConfigureInputQueueEndpoint(IInMemoryReceiveEndpointConfigurator configurator)
        {
            _observer = new ObservableObserver<ConsumeContext<A>>();

            _observer.GroupBy(x => x.Message.Name).Subscribe(value => Console.WriteLine("Key: {0}", value.Key));

            configurator.Observer(_observer);
        }
开发者ID:MassTransit,项目名称:MassTransit,代码行数:8,代码来源:Factory_Specs.cs

示例11: ConfigureInputQueueEndpoint

 protected override void ConfigureInputQueueEndpoint(IInMemoryReceiveEndpointConfigurator configurator)
 {
     long value = 0;
     configurator.Handler<PingMessage>(async context =>
     {
         if (Interlocked.Increment(ref value) == 1000)
             _completed.TrySetResult(true);
     });
 }
开发者ID:MassTransit,项目名称:MassTransit,代码行数:9,代码来源:PerformanceCounter_Specs.cs

示例12: ConfigureInputQueueEndpoint

        protected override void ConfigureInputQueueEndpoint(IInMemoryReceiveEndpointConfigurator configurator)
        {
            _first = Handler<FirstMessage>(configurator, async context =>
            {
                await context.ScheduleMessage(DateTime.Now, new SecondMessage());
            });

            _second = Handled<SecondMessage>(configurator);
        }
开发者ID:kotvisbj,项目名称:MassTransit,代码行数:9,代码来源:ScheduleMessage_Specs.cs

示例13: ConfigureInputQueueEndpoint

        protected override void ConfigureInputQueueEndpoint(IInMemoryReceiveEndpointConfigurator configurator)
        {
            configurator.Handler<JToken>(async context =>
            {
                await Console.Out.WriteLineAsync($"Received the token! {context.Message}");

                _completed.TrySetResult(context.Message);
            });
        }
开发者ID:kotvisbj,项目名称:MassTransit,代码行数:9,代码来源:ConsumeJToken_Specs.cs

示例14: ConfigureInputQueueEndpoint

        protected override void ConfigureInputQueueEndpoint(IInMemoryReceiveEndpointConfigurator configurator)
        {
            _count = 0;
            configurator.Handler<Interval>(async context =>
            {
                Interlocked.Increment(ref _count);
            });

            _done = Handled<Done>(configurator);
        }
开发者ID:kotvisbj,项目名称:MassTransit,代码行数:10,代码来源:Recurring_Specs.cs

示例15: ConfigureInputQueueEndpoint

        protected override void ConfigureInputQueueEndpoint(IInMemoryReceiveEndpointConfigurator configurator)
        {
            var sagaRepository = new InMemorySagaRepository<RegisterUserSaga>();
            configurator.Saga(sagaRepository);

            configurator.Handler<SendUserVerificationEmail>(async x =>
            {
                await Bus.Publish(new UserVerificationEmailSent(x.Message.CorrelationId, x.Message.Email));
            });
        }
开发者ID:MassTransit,项目名称:MassTransit,代码行数:10,代码来源:RegisterUser_Specs.cs


注:本文中的IInMemoryReceiveEndpointConfigurator类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。