• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# IInMemoryReceiveEndpointConfigurator类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: ConfigureInputQueueEndpoint

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

            configurator.Turnout<ProcessFile>(_busFactoryConfigurator, x =>
            {
                x.SuperviseInterval = TimeSpan.FromSeconds(1);
                x.SetJobFactory(async context => await Task.Delay(context.Message.Size));
            });
        }
开发者ID:kotvisbj,项目名称:MassTransit,代码行数:10,代码来源:TramJob_Specs.cs


示例17: ConfigureInputQueueEndpoint

        protected override void ConfigureInputQueueEndpoint(IInMemoryReceiveEndpointConfigurator configurator)
        {
            configurator.UseRetry(Retry.None);

            Handler<PingMessage>(configurator, async context =>
            {
                _attempts++;
                throw new IntentionalTestException();
            });
        }
开发者ID:jsmale,项目名称:MassTransit,代码行数:10,代码来源:Retry_Specs.cs


示例18: ConfigureInputQueueEndpoint

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

            configurator.UseTransform<A>(t =>
            {
                t.Set(x => x.Second, context => "World");
            });

            _received = Handled<A>(configurator);
        }
开发者ID:kotvisbj,项目名称:MassTransit,代码行数:11,代码来源:SetProperty_Specs.cs


示例19: ConfigureInputQueueEndpoint

        protected override void ConfigureInputQueueEndpoint(IInMemoryReceiveEndpointConfigurator configurator)
        {
            _commandHandler = Handler<SecureCommand>(configurator, async context =>
            {
                ConsumeContext<UserCredentials> credentials;
                if (context.TryGetMessage(out credentials))
                    _credentials.SetResult(credentials.Message);
            });

            _credentialsHandler = Handled<UserCredentials>(configurator);
        }
开发者ID:kotvisbj,项目名称:MassTransit,代码行数:11,代码来源:Enrichment_Specs.cs


示例20: ConfigureInputQueueEndpoint

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

            configurator.UseBsonSerializer();

            _handled = Handler<PingMessage>(configurator, async context =>
            {
                await context.RespondAsync(new PongMessage(context.Message.CorrelationId));
            });
        }
开发者ID:MassTransit,项目名称:MassTransit,代码行数:11,代码来源:SeparateSerializer_Specs.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IIndex类代码示例发布时间:2022-05-24
下一篇:
C# IImporter类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap