It would be useful to see an example of how to embed a CqrsFramework inside a services or query object. I might have an aggregate which needs to query other aggregates (or issue commands to other aggregates) in the handle function. Or I might have a query which needs to issue commands to some CqrsFramework when it sees certain events.
However, I need to pass the complete queries vec and services object to the CqrsFramework::new function, so it's not quite clear to me how to embed the framework inside the queries and services.
I do have a mostly working example using Arc::new_cyclic, but I'm not sure I like it.
Is new_cyclic ok? am I doing Things That Should Not Be Done?
It would be useful to see an example of how to embed a
CqrsFrameworkinside a services or query object. I might have an aggregate which needs to query other aggregates (or issue commands to other aggregates) in thehandlefunction. Or I might have a query which needs to issue commands to someCqrsFrameworkwhen it sees certain events.However, I need to pass the complete queries vec and services object to the
CqrsFramework::newfunction, so it's not quite clear to me how to embed the framework inside the queries and services.I do have a mostly working example using
Arc::new_cyclic, but I'm not sure I like it.Is
new_cyclicok? am I doing Things That Should Not Be Done?