According to uncle Bob's Clean Architecture, enterprise and application business rules (which conceptually are comprised of commands) are located in layers below the outer interface layers. Thus interfaces are free to run business rules whenever they are called. However, in some circumstances it's also necessary to run business rules in background processes, either individually or as part of workflows, either triggered by input from external interfaces or by job schedulers. In that case, where does a task queue service fit in the Clean Architecture?
The task queue is a detail like the UI or the web. Just another I/O mechanism.
For the use case it doesn't matter if it gets its input from a
That I/O independece makes use cases easy to test.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With