Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Disable() method to configurers. #162

Merged
merged 2 commits into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions aggregate.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,17 @@ type AggregateConfigurer interface {
// Aggregate handlers support the HandlesCommand() and RecordsEvent() route
// types.
Routes(...AggregateRoute)

// Disable prevents the handler from receiving any messages.
//
// The engine MUST NOT call any methods other than Configure() on a disabled
// handler.
//
// Disabling a handler is useful when the handler's configuration prevents
// it from operating, such as when it's missing a required dependency,
// without requiring the user to conditionally register the handler with the
// application.
Disable(...DisableOption)
}

// AggregateCommandScope performs engine operations within the context of a call
Expand Down
4 changes: 4 additions & 0 deletions disable.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package dogma

// DisableOption is an option that affects the behavior of a disabled handler.
type DisableOption struct{}
2 changes: 1 addition & 1 deletion docs/vale/config/vocabularies/Technical/accept.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[Dd]eduplication
[Dd]estroy
[Dd]isable
[Dd]isabled
Expand All @@ -19,5 +20,4 @@
[Oo]nly
[Vv]alidate
[Ww]hitespace
deduplication
ADR|adr
11 changes: 11 additions & 0 deletions integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,17 @@ type IntegrationConfigurer interface {
// Integration handlers support the HandlesCommand() and RecordsEvent()
// route types.
Routes(...IntegrationRoute)

// Disable prevents the handler from receiving any messages.
//
// The engine MUST NOT call any methods other than Configure() on a disabled
// handler.
//
// Disabling a handler is useful when the handler's configuration prevents
// it from operating, such as when it's missing a required dependency,
// without requiring the user to conditionally register the handler with the
// application.
Disable(...DisableOption)
}

// IntegrationCommandScope performs engine operations within the context of a
Expand Down
11 changes: 11 additions & 0 deletions process.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,17 @@ type ProcessConfigurer interface {
// Process handlers support the HandlesEvent(), ExecutesCommand() and
// SchedulesTimeout() route types.
Routes(...ProcessRoute)

// Disable prevents the handler from receiving any messages.
//
// The engine MUST NOT call any methods other than Configure() on a disabled
// handler.
//
// Disabling a handler is useful when the handler's configuration prevents
// it from operating, such as when it's missing a required dependency,
// without requiring the user to conditionally register the handler with the
// application.
Disable(...DisableOption)
}

// ProcessEventScope performs engine operations within the context of a call
Expand Down
11 changes: 11 additions & 0 deletions projection.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,17 @@ type ProjectionConfigurer interface {
//
// The default policy is UnicastProjectionDeliveryPolicy.
DeliveryPolicy(ProjectionDeliveryPolicy)

// Disable prevents the handler from receiving any messages.
//
// The engine MUST NOT call any methods other than Configure() on a disabled
// handler.
//
// Disabling a handler is useful when the handler's configuration prevents
// it from operating, such as when it's missing a required dependency,
// without requiring the user to conditionally register the handler with the
// application.
Disable(...DisableOption)
}

// ProjectionEventScope performs engine operations within the context of a call
Expand Down