callable() returns True for classes that override the __call__ method, which means the existing logic doesn't properly handle all backends (using a BookPostgres callback as the handler will break, for example).
This change uses hasattr to explicitly determine if the given handler:
callable()
returns True for classes that override the__call__
method, which means the existing logic doesn't properly handle all backends (using a BookPostgres callback as the handler will break, for example). This change useshasattr
to explicitly determine if the given handler:Is a class Has a start method Has a stop method