Skip to main content

sync_and_async_middleware

Mark a middleware factory as returning a hybrid middleware supporting both types of request.

def sync_and_async_middleware(
func: function
) - > function

Mark a middleware factory as returning a hybrid middleware supporting both types of request.

Parameters

NameTypeDescription
funcfunctionThe middleware factory function to be marked as capable of handling both sync and async requests

Returns

TypeDescription
functionThe original function decorated with attributes indicating both synchronous and asynchronous capability