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

Consider adding Now() method to scope interfaces. #141

Open
6 tasks
jmalloc opened this issue Jan 22, 2021 · 1 comment · Fixed by #143
Open
6 tasks

Consider adding Now() method to scope interfaces. #141

jmalloc opened this issue Jan 22, 2021 · 1 comment · Fixed by #143
Milestone

Comments

@jmalloc
Copy link
Member

jmalloc commented Jan 22, 2021

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 *
@jmalloc jmalloc added this to the 1.0.0 milestone Feb 8, 2021
@jmalloc
Copy link
Member Author

jmalloc commented Feb 8, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging a pull request may close this issue.

1 participant