EventStore 3.0 和发布事件
那么通过 Event Store 3.0 发布事件的推荐方式是什么?假设我像这样连接 EventStore:
.UsingAsynchronousDispatchScheduler()
.DispatchTo(new DelegateMessageDispatcher(DispatchCommit))
其中“DispatchCommit”看起来像这样:
DispatchCommit(Commit commit)
我可以看到提交的事件按预期触发。然而,ES 2.0 将 IContainer 传递到消息调度程序中,我可以解析总线实例并发送事件。我应该使用实现 IDispatchCommits 的类吗?
有人使用 ES 3.0 有什么想法吗?
So what would be the recommended way to publish events via Event Store 3.0? Assuming I wire up the EventStore like this:
.UsingAsynchronousDispatchScheduler()
.DispatchTo(new DelegateMessageDispatcher(DispatchCommit))
where 'DispatchCommit' looks like this:
DispatchCommit(Commit commit)
I can watch the committed events fire off as expected. However, ES 2.0 had the IContainer passing into the message dispatcher and I could resolve a bus instance and send events. Shall I use a class that implements IDispatchCommits ?
Anyone using ES 3.0 with any thoughts?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是我在生产中用于分派提交的代码: https://gist.github.com/1311195
我将容器配置为仅创建依赖项的单个实例。
Here's the code I'm using in production to dispatch commits: https://gist.github.com/1311195
I have my container configured to only create a single instance of the dependency.