You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current time is something you need to obtain often in the handler. We've hit a real requirement for this when writing a ProjectionMessageHandler.Compact() implementation that needs to remove data that is older than some threshold.
While in general I do not want to make the engine responsible for providing every possible dependency to the handlers, the fact that dogmatiq/testkit lets you scale/advance time artificially means that we do need some way to query the engine for the time it "thinks" it is.
Edit: I'm not sure we neccessarily want to add it to all of these interfaces, but I have put as asterisk next to those that I think probably need it most.
AggregateCommandScope
ProcessEventScope
ProcessTimeoutScope
IntegrationCommandScope
ProjectionEventScope
ProjectionCompactScope
The text was updated successfully, but these errors were encountered:
After discussing with @danilvpetrov and @koden-km we have decided only to implement ProjectionCompactScope.Now() until we have some concrete use cases for the others.
This issue has come up again in a concrete use case at cwx. TL;DR, an aggregate implementation is using time.Now() and it is therefore hard to assert about an exact timestamp in testkit. I think we should go ahead with adding Now() to all scopes.
The current time is something you need to obtain often in the handler. We've hit a real requirement for this when writing a
ProjectionMessageHandler.Compact()
implementation that needs to remove data that is older than some threshold.While in general I do not want to make the engine responsible for providing every possible dependency to the handlers, the fact that
dogmatiq/testkit
lets you scale/advance time artificially means that we do need some way to query the engine for the time it "thinks" it is.Edit: I'm not sure we neccessarily want to add it to all of these interfaces, but I have put as asterisk next to those that I think probably need it most.AggregateCommandScope
ProcessEventScope
ProcessTimeoutScope
IntegrationCommandScope
ProjectionEventScope
ProjectionCompactScope
The text was updated successfully, but these errors were encountered: