Skip to content

Commit

Permalink
Merge pull request #567 from dogmatiq/dogma-0.13.0
Browse files Browse the repository at this point in the history
Update Dogma to v0.13.0.
  • Loading branch information
jmalloc authored Mar 26, 2024
2 parents 073c121 + bcb1136 commit f467f98
Show file tree
Hide file tree
Showing 17 changed files with 154 additions and 37 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ The format is based on [Keep a Changelog], and this project adheres to
[keep a changelog]: https://keepachangelog.com/en/1.0.0/
[semantic versioning]: https://semver.org/spec/v2.0.0.html

## [0.2.0] - 2024-03-26

- **[BC]** Bump `dogmatiq/dogma` to v0.13.0.

## [0.1.8] - 2023-05-03

### Fixed
Expand Down Expand Up @@ -90,6 +94,7 @@ optimistic concurrency error.
[0.1.5]: https://github.com/dogmatiq/verity/releases/tag/v0.1.5
[0.1.6]: https://github.com/dogmatiq/verity/releases/tag/v0.1.6
[0.1.7]: https://github.com/dogmatiq/verity/releases/tag/v0.1.7
[0.2.0]: https://github.com/dogmatiq/verity/releases/tag/v0.2.0

<!-- version template
## [0.0.1] - YYYY-MM-DD
Expand Down
4 changes: 2 additions & 2 deletions app.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func (e *Engine) initApp(

// newQueue returns a new queue for a specific app.
func (e *Engine) newQueue(
cfg configkit.RichApplication,
_ configkit.RichApplication,
ds persistence.DataStore,
) *queue.Queue {
return &queue.Queue{
Expand Down Expand Up @@ -310,7 +310,7 @@ func (f *handlerFactory) VisitRichIntegration(_ context.Context, cfg configkit.R
return nil
}

func (f *handlerFactory) VisitRichProjection(_ context.Context, cfg configkit.RichProjection) error {
func (f *handlerFactory) VisitRichProjection(context.Context, configkit.RichProjection) error {
return nil
}

Expand Down
8 changes: 6 additions & 2 deletions engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@ func New(app dogma.Application, options ...EngineOption) *Engine {
}

// ExecuteCommand enqueues a command for execution.
func (e *Engine) ExecuteCommand(ctx context.Context, m dogma.Message) error {
func (e *Engine) ExecuteCommand(
ctx context.Context,
m dogma.Message,
options ...dogma.ExecuteCommandOption,
) error {
select {
case <-e.ready:
case <-ctx.Done():
Expand All @@ -68,7 +72,7 @@ func (e *Engine) ExecuteCommand(ctx context.Context, m dogma.Message) error {
mt := message.TypeOf(m)

if x, ok := e.executors[mt]; ok {
return x.ExecuteCommand(ctx, m)
return x.ExecuteCommand(ctx, m, options...)
}

return fmt.Errorf("no application accepts %s commands", mt)
Expand Down
22 changes: 15 additions & 7 deletions engine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,31 +31,39 @@ var _ = Describe("type Engine", func() {
c.RegisterAggregate(&AggregateMessageHandler{
ConfigureFunc: func(c dogma.AggregateConfigurer) {
c.Identity("<agg-name>", "e4ff048e-79f7-45e2-9f02-3b10d17614c6")
c.ConsumesCommandType(MessageC{})
c.ProducesEventType(MessageE{})
c.Routes(
dogma.HandlesCommand[MessageC](),
dogma.RecordsEvent[MessageE](),
)
},
})

c.RegisterProcess(&ProcessMessageHandler{
ConfigureFunc: func(c dogma.ProcessConfigurer) {
c.Identity("<proc-name>", "2ae0b937-e806-4e70-9b23-f36298f68973")
c.ConsumesEventType(MessageE{})
c.ProducesCommandType(MessageI{})
c.Routes(
dogma.HandlesEvent[MessageE](),
dogma.ExecutesCommand[MessageI](),
)
},
})

c.RegisterIntegration(&IntegrationMessageHandler{
ConfigureFunc: func(c dogma.IntegrationConfigurer) {
c.Identity("<int-name>", "27fb3936-6f88-4873-8c56-e6a1d01f027a")
c.ConsumesCommandType(MessageI{})
c.ProducesEventType(MessageJ{})
c.Routes(
dogma.HandlesCommand[MessageI](),
dogma.RecordsEvent[MessageJ](),
)
},
})

c.RegisterProjection(&ProjectionMessageHandler{
ConfigureFunc: func(c dogma.ProjectionConfigurer) {
c.Identity("<proj-name>", "b084ea4f-87d1-4001-8c1a-347c29baed35")
c.ConsumesEventType(MessageE{})
c.Routes(
dogma.HandlesEvent[MessageE](),
)
c.DeliveryPolicy(deliveryPolicy)
},
})
Expand Down
4 changes: 3 additions & 1 deletion engineoption_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ var TestApplication = &Application{
c.RegisterProjection(&ProjectionMessageHandler{
ConfigureFunc: func(c dogma.ProjectionConfigurer) {
c.Identity("<projection-name>", "b084ea4f-87d1-4001-8c1a-347c29baed35")
c.ConsumesEventType(MessageA{})
c.Routes(
dogma.HandlesEvent[MessageA](),
)
},
})
},
Expand Down
11 changes: 6 additions & 5 deletions eventstream/internal/streamtest/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,12 @@ func Declare(
id := event0.Parcel.Envelope.GetSourceHandler()
c.Identity(id.GetName(), id.GetKey())

c.ConsumesCommandType(dogmafixtures.MessageX{})

c.ProducesEventType(dogmafixtures.MessageA{})
c.ProducesEventType(dogmafixtures.MessageB{})
c.ProducesEventType(dogmafixtures.MessageC{})
c.Routes(
dogma.HandlesCommand[dogmafixtures.MessageX](),
dogma.RecordsEvent[dogmafixtures.MessageA](),
dogma.RecordsEvent[dogmafixtures.MessageB](),
dogma.RecordsEvent[dogmafixtures.MessageC](),
)
},
})
},
Expand Down
2 changes: 1 addition & 1 deletion fixtures/parcel.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func NewParcel(
SourceInstanceId: "<instance>",
CreatedAt: marshalkit.MustMarshalEnvelopeTime(createdAt),
ScheduledFor: marshalkit.MustMarshalEnvelopeTime(scheduledFor),
Description: dogma.DescribeMessage(m),
Description: m.MessageDescription(),
},
Message: m,
CreatedAt: createdAt,
Expand Down
12 changes: 6 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ module github.com/dogmatiq/verity
go 1.21

require (
github.com/dogmatiq/configkit v0.12.2
github.com/dogmatiq/configkit v0.13.0
github.com/dogmatiq/cosyne v0.2.0
github.com/dogmatiq/discoverkit v0.1.2
github.com/dogmatiq/dodeca v1.4.2
github.com/dogmatiq/dogma v0.12.1
github.com/dogmatiq/dogma v0.13.0
github.com/dogmatiq/iago v0.4.0
github.com/dogmatiq/interopspec v0.5.3
github.com/dogmatiq/kyu v0.2.0
Expand Down Expand Up @@ -46,11 +46,11 @@ require (
github.com/lib/pq v1.10.2 // indirect
github.com/mattn/go-sqlite3 v1.14.5 // indirect
github.com/x448/float16 v0.8.4 // indirect
golang.org/x/crypto v0.20.0 // indirect
golang.org/x/net v0.21.0 // indirect
golang.org/x/sys v0.17.0 // indirect
golang.org/x/crypto v0.21.0 // indirect
golang.org/x/net v0.22.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/tools v0.17.0 // indirect
golang.org/x/tools v0.19.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 // indirect
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
Loading

0 comments on commit f467f98

Please sign in to comment.