You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> The new programming model for authoring Functions in Node.js (V4) is currently in preview. Compared to the current model, the new experience is designed to be more flexible and intuitive for JavaScript/TypeScript developers. Learn more about the differences between the models in the [Node.js upgrade guide](../functions-node-upgrade-v4.md).
35
-
>
36
-
> In the following code snippets, JavaScript (V4 model) denotes programming model V4, the new experience.
35
+
37
36
::: zone-end
38
37
39
38
@@ -63,7 +62,7 @@ In this example, the values `F1`, `F2`, `F3`, and `F4` are the names of other fu
63
62
64
63
::: zone pivot="csharp"
65
64
66
-
# [C# (InProc)](#tab/csharp-inproc)
65
+
# [C# (InProc)](#tab/in-process)
67
66
68
67
```csharp
69
68
[FunctionName("Chaining")]
@@ -86,7 +85,7 @@ public static async Task<object> Run(
86
85
87
86
You can use the `context` parameter to invoke other functions by name, pass parameters, and return function output. Each time the code calls `await`, the Durable Functions framework checkpoints the progress of the current function instance. If the process or virtual machine recycles midway through the execution, the function instance resumes from the preceding `await` call. For more information, see the next section, Pattern #2: Fan out/fan in.
88
87
89
-
# [C# (Isolated)](#tab/csharp-isolated)
88
+
# [C# (Isolated)](#tab/isolated-process)
90
89
91
90
```csharp
92
91
[Function("Chaining")]
@@ -110,9 +109,9 @@ public static async Task<object> Run(
110
109
You can use the `context` parameter to invoke other functions by name, pass parameters, and return function output. Each time the code calls `await`, the Durable Functions framework checkpoints the progress of the current function instance. If the process or virtual machine recycles midway through the execution, the function instance resumes from the preceding `await` call. For more information, see the next section, Pattern #2: Fan out/fan in.
111
110
112
111
::: zone-end
113
-
::: zone pivot="node"
112
+
::: zone pivot="javascript"
114
113
115
-
# [JavaScript (V3 model)](#tab/v3-model)
114
+
# [V3 model](#tab/v3-model)
116
115
117
116
```javascript
118
117
constdf=require("durable-functions");
@@ -134,7 +133,7 @@ You can use the `context.df` object to invoke other functions by name, pass para
134
133
> [!NOTE]
135
134
> The `context` object in JavaScript represents the entire [function context](../functions-reference-node.md#context-object). Access the Durable Functions context using the `df` property on the main context.
136
135
137
-
# [JavaScript (V4 model)](#tab/v4-model)
136
+
# [V4 model](#tab/v4-model)
138
137
139
138
```javascript
140
139
constdf=require("durable-functions");
@@ -250,7 +249,7 @@ The Durable Functions extension handles this pattern with relatively simple code
250
249
251
250
::: zone pivot="csharp"
252
251
253
-
# [C# (InProc)](#tab/csharp-inproc)
252
+
# [C# (InProc)](#tab/in-process)
254
253
255
254
```csharp
256
255
[FunctionName("FanOutFanIn")]
@@ -279,7 +278,7 @@ The fan-out work is distributed to multiple instances of the `F2` function. The
279
278
280
279
The automatic checkpointing that happens at the `await` call on `Task.WhenAll` ensures that a potential midway crash or reboot doesn't require restarting an already completed task.
281
280
282
-
# [C# (Isolated)](#tab/csharp-isolated)
281
+
# [C# (Isolated)](#tab/isolated-process)
283
282
284
283
```csharp
285
284
[Function("FanOutFanIn")]
@@ -309,9 +308,9 @@ The fan-out work is distributed to multiple instances of the `F2` function. The
309
308
The automatic checkpointing that happens at the `await` call on `Task.WhenAll` ensures that a potential midway crash or reboot doesn't require restarting an already completed task.
310
309
311
310
::: zone-end
312
-
::: zone pivot="node"
311
+
::: zone pivot="javascript"
313
312
314
-
# [JavaScript (V3 model)](#tab/v3-model)
313
+
# [V3 model](#tab/v3-model)
315
314
316
315
```javascript
317
316
constdf=require("durable-functions");
@@ -337,7 +336,7 @@ The fan-out work is distributed to multiple instances of the `F2` function. The
337
336
338
337
The automatic checkpointing that happens at the `yield` call on `context.df.Task.all` ensures that a potential midway crash or reboot doesn't require restarting an already completed task.
339
338
340
-
# [JavaScript (V4 model)](#tab/v4-model)
339
+
# [V4 model](#tab/v4-model)
341
340
342
341
```javascript
343
342
constdf=require("durable-functions");
@@ -526,7 +525,7 @@ The following code implements a basic monitor:
@@ -791,7 +790,7 @@ These examples create an approval process to demonstrate the human interaction p
791
790
792
791
::: zone pivot="csharp"
793
792
794
-
# [C# (InProc)](#tab/csharp-inproc)
793
+
# [C# (InProc)](#tab/in-process)
795
794
796
795
```csharp
797
796
[FunctionName("ApprovalWorkflow")]
@@ -820,7 +819,7 @@ public static async Task Run(
820
819
821
820
To create the durable timer, call `context.CreateTimer`. The notification is received by `context.WaitForExternalEvent`. Then, `Task.WhenAny` is called to decide whether to escalate (timeout happens first) or process the approval (the approval is received before timeout).
822
821
823
-
# [C# (Isolated)](#tab/csharp-isolated)
822
+
# [C# (Isolated)](#tab/isolated-process)
824
823
825
824
```csharp
826
825
[Function("ApprovalWorkflow")]
@@ -850,9 +849,9 @@ public static async Task Run(
850
849
To create the durable timer, call `context.CreateTimer`. The notification is received by `context.WaitForExternalEvent`. Then, `Task.WhenAny` is called to decide whether to escalate (timeout happens first) or process the approval (the approval is received before timeout).
To create the durable timer, call `context.df.createTimer`. The notification is received by `context.df.waitForExternalEvent`. Then, `context.df.Task.any` is called to decide whether to escalate (timeout happens first) or process the approval (the approval is received before timeout).
879
878
880
-
# [JavaScript (V4 model)](#tab/v4-model)
879
+
# [V4 model](#tab/v4-model)
881
880
882
881
```javascript
883
882
constdf=require("durable-functions");
@@ -1034,7 +1033,7 @@ An event can also be raised using the durable orchestration client from another
1034
1033
1035
1034
::: zone pivot="csharp"
1036
1035
1037
-
# [C# (InProc)](#tab/csharp-inproc)
1036
+
# [C# (InProc)](#tab/in-process)
1038
1037
1039
1038
```csharp
1040
1039
[FunctionName("RaiseEventToOrchestration")]
@@ -1047,7 +1046,7 @@ public static async Task Run(
1047
1046
}
1048
1047
```
1049
1048
1050
-
# [C# (Isolated)](#tab/csharp-isolated)
1049
+
# [C# (Isolated)](#tab/isolated-process)
1051
1050
1052
1051
```csharp
1053
1052
[Function("RaiseEventToOrchestration")]
@@ -1061,9 +1060,9 @@ public static async Task Run(
1061
1060
```
1062
1061
1063
1062
::: zone-end
1064
-
::: zone pivot="node"
1063
+
::: zone pivot="javascript"
1065
1064
1066
-
# [JavaScript (V3 model)](#tab/v3-model)
1065
+
# [V3 model](#tab/v3-model)
1067
1066
1068
1067
```javascript
1069
1068
constdf=require("durable-functions");
@@ -1075,7 +1074,7 @@ module.exports = async function (context) {
1075
1074
};
1076
1075
```
1077
1076
1078
-
# [JavaScript (V4 model)](#tab/v4-model)
1077
+
# [V4 model](#tab/v4-model)
1079
1078
1080
1079
```javascript
1081
1080
constdf=require("durable-functions");
@@ -1161,7 +1160,7 @@ You can use [Durable entities](durable-functions-entities.md) to easily implemen
1161
1160
1162
1161
::: zone pivot="csharp"
1163
1162
1164
-
# [C# (InProc)](#tab/csharp-inproc)
1163
+
# [C# (InProc)](#tab/in-process)
1165
1164
1166
1165
```csharp
1167
1166
[FunctionName("Counter")]
@@ -1204,14 +1203,14 @@ public class Counter
1204
1203
}
1205
1204
```
1206
1205
1207
-
# [C# (Isolated)](#tab/csharp-isolated)
1206
+
# [C# (Isolated)](#tab/isolated-process)
1208
1207
1209
1208
Durable entities are currently not supported in the .NET-isolated worker.
@@ -1326,7 +1325,7 @@ Clients can enqueue *operations* for (also known as "signaling") an entity funct
1326
1325
1327
1326
::: zone pivot="csharp"
1328
1327
1329
-
# [C# (InProc)](#tab/csharp-inproc)
1328
+
# [C# (InProc)](#tab/in-process)
1330
1329
1331
1330
```csharp
1332
1331
[FunctionName("EventHubTriggerCSharp")]
@@ -1346,14 +1345,14 @@ public static async Task Run(
1346
1345
> [!NOTE]
1347
1346
> Dynamically generated proxies are also available in .NET for signaling entities in a type-safe way. And in addition to signaling, clients can also query for the state of an entity function using [type-safe methods](durable-functions-dotnet-entities.md#accessing-entities-through-interfaces) on the orchestration client binding.
1348
1347
1349
-
# [C# (Isolated)](#tab/csharp-isolated)
1348
+
# [C# (Isolated)](#tab/isolated-process)
1350
1349
1351
1350
Durable entities are currently not supported in the .NET-isolated worker.
1352
1351
1353
1352
::: zone-end
1354
-
::: zone pivot="node"
1353
+
::: zone pivot="javascript"
1355
1354
1356
-
# [JavaScript (V3 model)](#tab/v3-model)
1355
+
# [V3 model](#tab/v3-model)
1357
1356
1358
1357
```javascript
1359
1358
constdf=require("durable-functions");
@@ -1366,7 +1365,7 @@ module.exports = async function (context) {
0 commit comments