Skip to content

Commit 90500a2

Browse files
committed
Add support for durable client functions
1 parent 0e33ce3 commit 90500a2

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

azure/durable_functions/decorators/durable_app.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)