The problem was caused by wrapping the original function with the durable decorator, which loses information about the fact that the underlying function is a coroutine. Using inspect.iscoroutinefunction on the decorated object always returns False.
The fix isn't the most pretty, basically adding a boolean parameter (what can't be fixed by an extra boolean? 😅) to track whether we are registering a coroutine or a simple function.
Fixes a regression introduced in #79
The problem was caused by wrapping the original function with the
durable
decorator, which loses information about the fact that the underlying function is a coroutine. Usinginspect.iscoroutinefunction
on the decorated object always returnsFalse
.The fix isn't the most pretty, basically adding a boolean parameter (what can't be fixed by an extra boolean? 😅) to track whether we are registering a coroutine or a simple function.