Skip to content

Commit

Permalink
Add functional options to command executor.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmalloc committed Sep 26, 2023
1 parent a2e5184 commit f7de643
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
10 changes: 6 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ The format is based on [Keep a Changelog], and this project adheres to

### Added

- **[ENGINE BC]** Added `...RegisterAggregateOption` parameter to `ApplicationConfigurer.RegisterAggregate()`
- **[ENGINE BC]** Added `...RegisterProcessOption` parameter to `ApplicationConfigurer.RegisterProcess()`
- **[ENGINE BC]** Added `...RegisterIntegrationOption` parameter to `ApplicationConfigurer.RegisterIntegration()`
- **[ENGINE BC]** Added `...RegisterProjectionOption` parameter to `ApplicationConfigurer.RegisterProjection()`
- **[ENGINE BC]** Added functional options to the following methods and functions:
- `ApplicationConfigurer.RegisterAggregate()`
- `ApplicationConfigurer.RegisterProcess()`
- `ApplicationConfigurer.RegisterIntegration()`
- `ApplicationConfigurer.RegisterProjection()`
- `CommandExecutor.ExecuteCommand()`

### Removed

Expand Down
6 changes: 5 additions & 1 deletion external.go → executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,9 @@ type CommandExecutor interface {
// The application SHOULD assume that the command is executed
// asynchronously; it has not necessarily executed by the time the method
// returns.
ExecuteCommand(context.Context, Command) error
ExecuteCommand(context.Context, Command, ...ExecuteCommandOption) error
}

// ExecuteCommandOption is an option that affects the behavior of a call to the
// ExecuteCommand() method of the [CommandExecutor] interface.
type ExecuteCommandOption struct{}
2 changes: 1 addition & 1 deletion projection.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ type ProjectionCompactScope interface {
type NoCompactBehavior struct{}

// Compact does nothing.
func (NoCompactBehavior) Compact(ctx context.Context, s ProjectionCompactScope) error {
func (NoCompactBehavior) Compact(context.Context, ProjectionCompactScope) error {
return nil
}

Expand Down

0 comments on commit f7de643

Please sign in to comment.