Skip to main content
1 of 2
Fabio
  • 3.2k
  • 1
  • 20
  • 26

It is true that if you start using async-await it spreads as a zombie along application pipeline and you will be forced to use async everywhere.

Try to approach design from a bit different angle - domain logic care only about data.
So we can put all IO related code outside of domain layers as close to the top layers as possible.

1 Load required data asynchronously
2 Pass data to the business logic
3 Process data synchronously
4 Return possible results
5 Save processed results asynchronously

Fabio
  • 3.2k
  • 1
  • 20
  • 26