Skip to content

Commit 00e3a34

Browse files
authored
Add initial blueprint support (#432)
1 parent 8b5c1f3 commit 00e3a34

File tree

3 files changed

+21
-6
lines changed

3 files changed

+21
-6
lines changed

azure/durable_functions/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ def validate_extension_bundles():
7474

7575
try:
7676
# disabling linter on this line because it fails to recognize the conditional export
77-
from .decorators import DFApp # noqa
77+
from .decorators import DFApp, BluePrint # noqa
7878
__all__.append('DFApp')
79+
__all__.append('BluePrint')
7980
except ModuleNotFoundError:
8081
pass
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# Copyright (c) Microsoft Corporation. All rights reserved.
22
# Licensed under the MIT License.
33
"""Decorator definitions for Durable Functions."""
4-
from .durable_app import DFApp
4+
from .durable_app import DFApp, BluePrint
55

66
__all__ = [
7-
"DFApp"
7+
"DFApp",
8+
"BluePrint"
89
]

azure/durable_functions/decorators/durable_app.py

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,14 @@
1111
from functools import wraps
1212

1313

14-
class DFApp(FunctionRegister, TriggerApi, BindingApi):
15-
"""Durable Functions (DF) app.
14+
class BluePrint(TriggerApi, BindingApi):
15+
"""Durable Functions (DF) blueprint container.
16+
17+
It allows functions to be declared via trigger and binding decorators,
18+
but does not automatically index/register these functions.
1619
17-
Exports the decorators required to register DF Function-types.
20+
To register these functions, utilize the `register_functions` method from any
21+
:class:`FunctionRegister` subclass, such as `DFApp`.
1822
"""
1923

2024
def __init__(self,
@@ -226,3 +230,12 @@ def decorator():
226230
return decorator()
227231

228232
return wrap
233+
234+
235+
class DFApp(BluePrint, FunctionRegister):
236+
"""Durable Functions (DF) app.
237+
238+
Exports the decorators required to declare and index DF Function-types.
239+
"""
240+
241+
pass

0 commit comments

Comments
 (0)