本文整理汇总了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");
});
}
示例2: ConfigureInputQueueEndpoint
protected override void ConfigureInputQueueEndpoint(IInMemoryReceiveEndpointConfigurator configurator)
{
_consumer = new OneMessageConsumer(GetTask<MessageA>());
configurator.Consumer(() => _consumer);
}
示例3: ConfigureInputQueueEndpoint
protected override void ConfigureInputQueueEndpoint(IInMemoryReceiveEndpointConfigurator configurator)
{
configurator.Handler<PingMessage>(async context =>
{
await context.RespondAsync(new PongMessage(context.Message.CorrelationId));
});
}
示例4: ConfigureInputQueueEndpoint
protected override void ConfigureInputQueueEndpoint(IInMemoryReceiveEndpointConfigurator configurator)
{
_bookingRequestSagaRepository = new InMemorySagaRepository<BookingRequestState>();
_bookingRequestStateMachine = new BookingRequestStateMachine();
configurator.StateMachineSaga(_bookingRequestStateMachine, _bookingRequestSagaRepository);
}
示例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)));
}
示例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)));
}
示例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));
}
示例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);
}
示例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()));
}
示例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);
}
示例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);
});
}
示例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);
}
示例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);
});
}
示例14: ConfigureInputQueueEndpoint
protected override void ConfigureInputQueueEndpoint(IInMemoryReceiveEndpointConfigurator configurator)
{
_count = 0;
configurator.Handler<Interval>(async context =>
{
Interlocked.Increment(ref _count);
});
_done = Handled<Done>(configurator);
}
示例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));
});
}