thenativeweb / node-cqrs-domain

Node-cqrs-domain is a node.js module based on nodeEventStore that. It can be very useful as domain component if you work with (d)ddd, cqrs, eventdenormalizer, host, etc.
http://cqrs.js.org/pages/domain.html
MIT License
269 stars 57 forks source link

Domain.stop() #110

Closed alemhnan closed 6 years ago

alemhnan commented 6 years ago

Is it possible to stop the domain programmatically? It is useful for testing purposes. Now we need to stop with a process.exit. That makes more difficult to use a test runner.

adrai commented 6 years ago

if you call disconnect() on this objects:

domain.eventStore.disconnect()
domain.aggregateLock.disconnect()
if (domain.commandBumper) domain.commandBumper.disconnect()

this should do the trick

alemhnan commented 6 years ago

Super. Thanks a lot.