Search code examples
background-processabp-framework

ABP Framework - To which layer belongs background worker


I searched the documentation without finding a clear answer to this question. I want to create a background worker in ABP Framework (https://docs.abp.io/en/abp/latest/Background-Workers).

But I don't know in which project / layer I should create it. I have the feeling the background job belongs to Domain layer. Is it correct? Does it belongs to the Application layer instead? Or does it depends of what the background worker does? What is the best practice?


Solution

  • As you said, I think it depends on what the background worker does. But generally speaking, I think it should be in the domain layer because it's not a use-case that can be triggered with user/actor interaction, it is just a worker service that runs periodically.