C# 클래스 paramore.brighter.commandprocessor.CommandProcessorBuilder

Class CommandProcessorBuilder. Provides a fluent interface to construct a CommandProcessor. We need to identify the following dependencies in order to create a CommandProcessor A HandlerConfiguration containing a IAmASubscriberRegistry and a IAmAHandlerFactory. You can use SubscriberRegistry to provide the IAmASubscriberRegistry but you need to implement your own IAmAHandlerFactory, for example using your preferred Inversion of Control (IoC) container A IAmAPolicyRegistry containing a list of policies that you want to be accessible to the CommandProcessor. You can use PolicyRegistry to provide the IAmAPolicyRegistry. Policies are expected to be Polly !:https://github.com/michael-wolfenden/Polly Policy references. If you do not need any policies around quality of service (QoS) concerns - you do not have Work Queues and/or do not intend to use Polly Policies for QoS concerns - you can use NoPolicy to indicate you do not need them. A ILog that is the logger to use for diagnostic feedback. ILog is defined by LibLog !:hhttps://github.com/damianh/LibLog as an abstraction over logging frameworks and allows us to support your preferred logging framework A MessagingConfiguration describing how you want to configure Task Queues for the CommandProcessor. We store messages in a IAmAMessageStore for later replay (in case we need to compensate by trying a message again). We send messages to a Task Queue via a IAmAMessageProducer and we want to know how to map the IRequest (Command or Event) to a Message using a IAmAMessageMapper using an IAmAMessageMapperRegistry. You can use the default MessageMapperRegistry to register the association. You need to provide a IAmAMessageMapperFactory so that we can create instances of your IAmAMessageMapper. You need to provide a IAmAMessageMapperFactory when using MessageMapperRegistry so that we can create instances of your mapper. If you don't want to use Task Queues i.e. you are just using a synchronous Command Dispatcher approach, then use the NoTaskQueues method to indicate your intent Finally we need to provide a IRequestContext to provide context to requests handlers in the pipeline that can be used to pass information without using the message that initiated the pipeline. We instantiate this via a user-provided IAmARequestContextFactory. The default approach is use InMemoryRequestContextFactory to provide a RequestContext unless you have a requirement to replace this, such as in testing.
상속: INeedAHandlers, INeedPolicy, INeedLogging, INeedMessaging, INeedARequestContext, IAmACommandProcessorBuilder
파일 보기 프로젝트 열기: iancooper/Paramore 1 사용 예제들

공개 메소드들

메소드 설명
Build ( ) : CommandProcessor

Builds the CommandProcessor from the configuration.

DefaultPolicy ( ) : INeedMessaging

Use this if you do not require a policy and only want to retry once(i.e. No Tasks Queues or QoS needs).

Handlers ( HandlerConfiguration handlerConfiguration ) : INeedPolicy

Supplies the specified handler configuration, so that we can register subscribers and the handler factory used to create instances of them

NoTaskQueues ( ) : INeedARequestContext

Use to indicate that you are not using Task Queues.

Policies ( IAmAPolicyRegistry thePolicyRegistry ) : INeedMessaging

Supplies the specified the policy registry, so we can use policies for Task Queues or in user-defined request handlers such as ExceptionHandler that provide quality of service concerns

RequestContextFactory ( IAmARequestContextFactory requestContextFactory ) : IAmACommandProcessorBuilder

The factory for IRequestContext used within the pipeline to pass information between IHandleRequests{T} steps. If you do not need to override provide InMemoryRequestContextFactory.

TaskQueues ( MessagingConfiguration configuration ) : INeedARequestContext

The CommandProcessor wants to support CommandProcessor.Post{T}(T) or CommandProcessor.Repost using Task Queues. You need to provide a policy to specify how QoS issues, specifically CommandProcessor.RETRYPOLICY or CommandProcessor.CIRCUITBREAKER are handled by adding appropriate Policies when choosing this option.

With ( ) : INeedAHandlers

Begins the Fluent Interface

비공개 메소드들

메소드 설명
CommandProcessorBuilder ( ) : System

메소드 상세

Build() 공개 메소드

Builds the CommandProcessor from the configuration.
public Build ( ) : CommandProcessor
리턴 CommandProcessor

DefaultPolicy() 공개 메소드

Use this if you do not require a policy and only want to retry once(i.e. No Tasks Queues or QoS needs).
public DefaultPolicy ( ) : INeedMessaging
리턴 INeedMessaging

Handlers() 공개 메소드

Supplies the specified handler configuration, so that we can register subscribers and the handler factory used to create instances of them
public Handlers ( HandlerConfiguration handlerConfiguration ) : INeedPolicy
handlerConfiguration HandlerConfiguration The handler configuration.
리턴 INeedPolicy

NoTaskQueues() 공개 메소드

Use to indicate that you are not using Task Queues.
public NoTaskQueues ( ) : INeedARequestContext
리턴 INeedARequestContext

Policies() 공개 메소드

Supplies the specified the policy registry, so we can use policies for Task Queues or in user-defined request handlers such as ExceptionHandler that provide quality of service concerns
The policy registry is missing the CommandProcessor.RETRYPOLICY policy which is required The policy registry is missing the CommandProcessor.CIRCUITBREAKER policy which is required
public Policies ( IAmAPolicyRegistry thePolicyRegistry ) : INeedMessaging
thePolicyRegistry IAmAPolicyRegistry The policy registry.
리턴 INeedMessaging

RequestContextFactory() 공개 메소드

The factory for IRequestContext used within the pipeline to pass information between IHandleRequests{T} steps. If you do not need to override provide InMemoryRequestContextFactory.
public RequestContextFactory ( IAmARequestContextFactory requestContextFactory ) : IAmACommandProcessorBuilder
requestContextFactory IAmARequestContextFactory The request context factory.
리턴 IAmACommandProcessorBuilder

TaskQueues() 공개 메소드

The CommandProcessor wants to support CommandProcessor.Post{T}(T) or CommandProcessor.Repost using Task Queues. You need to provide a policy to specify how QoS issues, specifically CommandProcessor.RETRYPOLICY or CommandProcessor.CIRCUITBREAKER are handled by adding appropriate Policies when choosing this option.
public TaskQueues ( MessagingConfiguration configuration ) : INeedARequestContext
configuration MessagingConfiguration The Task Queues configuration.
리턴 INeedARequestContext

With() 공개 정적인 메소드

Begins the Fluent Interface
public static With ( ) : INeedAHandlers
리턴 INeedAHandlers