Skip to content

Commit

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

## Unreleased - ETA 2023-10-09

### 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()`

### Removed

This release marks 6 months since the release of [0.12.0], which deprecated
Expand Down
24 changes: 20 additions & 4 deletions application.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,32 @@ type ApplicationConfigurer interface {

// RegisterAggregate configures the engine to route messages for an
// aggregate.
RegisterAggregate(AggregateMessageHandler)
RegisterAggregate(AggregateMessageHandler, ...RegisterAggregateOption)

// RegisterProcess configures the engine to route messages for a process.
RegisterProcess(ProcessMessageHandler)
RegisterProcess(ProcessMessageHandler, ...RegisterProcessOption)

// RegisterIntegration configures the engine to route messages for an
// integration.
RegisterIntegration(IntegrationMessageHandler)
RegisterIntegration(IntegrationMessageHandler, ...RegisterIntegrationOption)

// RegisterProjection configures the engine to route messages for a
// projection.
RegisterProjection(ProjectionMessageHandler)
RegisterProjection(ProjectionMessageHandler, ...RegisterProjectionOption)
}

// RegisterAggregateOption is an option that affects the behavior of a call to
// the RegisterAggregate() method of the [ApplicationConfigurer] interface.
type RegisterAggregateOption struct{}

// RegisterProcessOption is an option that affects the behavior of a call to
// the RegisterProcess() method of the [ApplicationConfigurer] interface.
type RegisterProcessOption struct{}

// RegisterIntegrationOption is an option that affects the behavior of a call to
// the RegisterIntegration() method of the [ApplicationConfigurer] interface.
type RegisterIntegrationOption struct{}

// RegisterProjectionOption is an option that affects the behavior of a call to
// the RegisterProjection() method of the [ApplicationConfigurer] interface.
type RegisterProjectionOption struct{}

0 comments on commit a2e5184

Please sign in to comment.