I have a layered architecture and usually put things like try/catches, logging and now async at the top level service layer so my domain code and repositories are written synchronously and then I wrap the calls in my service layer with an await task.run so I can keep the Async naming and logic in one layer. Is this OK? Or is there a reason to have async in all the child methods / lower layers as well? Will it actually spawn more threads or still only be 1 async thread that does the magic?
If there is no issue with this, I have one problem where in my repository I need to use HttpClient but it only has async methods forcing me to use async lower in my architecture where I don't want to. Is there a way to call these methods without await/async and then at a higher layer method (in my service layer) still wrap in a task.run without blocking? Basically I do not want any methods to be async in my repository and would rather them be in my service layer which makes calls to the repository and other domain methods.