fastapi-cache icon indicating copy to clipboard operation
fastapi-cache copied to clipboard

Added typehint for Callable[P, R] in the decorator

Open fheinze-tkb opened this issue 1 year ago • 0 comments

My colleague and I had the issue that we had to use async everytime we use the cache decorator, even if we didn't want to mark that function as async. In the decorator.py we saw that you support Coroutines and Callables (by calling run_in_threadpool) but the typehint for the func only supported Coroutines.

Thanks and best wishes!

fheinze-tkb avatar Jun 04 '24 12:06 fheinze-tkb