File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
azure/durable_functions/decorators Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -198,6 +198,17 @@ async def df_client_middleware(*args, **kwargs):
198198 # Invoke user code with rich DF Client binding
199199 return await user_code (* args , ** kwargs )
200200
201+ # Todo: This feels awkward - however, there are two reasons that I can't naively implement
202+ # this in the same way as entities and orchestrators:
203+ # 1. We intentionally wrap this exported signature with @wraps, to preserve the original
204+ # signature of the user code. This means that we can't just assign a new object to the
205+ # fb._function._func, as that would overwrite the original signature.
206+ # 2. I have not yet fully tested the behavior of overriding __call__ on an object with an
207+ # async method.
208+ # Here we lose type hinting and auto-documentation - not great. Need to find a better way
209+ # to do this.
210+ df_client_middleware ._func = fb ._function ._func
211+
201212 user_code_with_rich_client = df_client_middleware
202213 fb ._function ._func = user_code_with_rich_client
203214
You can’t perform that action at this time.
0 commit comments