To async or not to async?
How would you define a library interface for a service that probably will be implemented with an in memory procedure - let's say returning a mapped value to a key you registered programmatically - and a user of your API might want to implement a decorator that needs a 'long running task' - for example you want to log a msg into your db or load additional mapping from a file?
Would you define the interface to return a Task<string> or just a string?
@Fandermill Thank you for an interesting question. It inspired me to write an article: https://blog.ploeh.dk/2024/07/08/should-interfaces-be-asynchronous
@ploeh Thank you for your article, such an interesting read!
I went with the notion that it's easier to make it async afterwards than the other way around. And by extend also being conservative about what you send.
Thanks!