mirror of https://github.com/dapr/docs.git
add js limitation
Signed-off-by: Hannah Hunter <hannahhunter@microsoft.com>
This commit is contained in:
parent
7f45c9a8eb
commit
3018badb59
|
@ -334,14 +334,7 @@ Failure to follow this rule could result in undefined behavior. Any background p
|
|||
|
||||
For example, instead of this:
|
||||
|
||||
{{< tabs JavaScript ".NET" Java >}}
|
||||
|
||||
{{% codetab %}}
|
||||
|
||||
```javascript
|
||||
// DON'T DO THIS!
|
||||
```
|
||||
{{% /codetab %}}
|
||||
{{< tabs ".NET" Java JavaScript >}}
|
||||
|
||||
{{% codetab %}}
|
||||
|
||||
|
@ -364,19 +357,17 @@ ctx.createTimer(Duration.ofSeconds(5)).await();
|
|||
|
||||
{{% /codetab %}}
|
||||
|
||||
{{% codetab %}}
|
||||
|
||||
Don't declare JavaScript workflow as `async`. The Node.js runtime doesn't guarantee that asynchronous functions are deterministic.
|
||||
|
||||
{{% /codetab %}}
|
||||
|
||||
{{< /tabs >}}
|
||||
|
||||
Do this:
|
||||
|
||||
{{< tabs JavaScript ".NET" Java >}}
|
||||
|
||||
{{% codetab %}}
|
||||
|
||||
```javascript
|
||||
// Do this!!
|
||||
```
|
||||
|
||||
{{% /codetab %}}
|
||||
{{< tabs ".NET" Java JavaScript >}}
|
||||
|
||||
{{% codetab %}}
|
||||
|
||||
|
@ -398,6 +389,12 @@ ctx.createTimer(Duration.ofSeconds(5)).await();
|
|||
|
||||
{{% /codetab %}}
|
||||
|
||||
{{% codetab %}}
|
||||
|
||||
Since the Node.js runtime doesn't guarantee that asynchronous functions are deterministic, always declare JavaScript workflow as synchronous generator functions.
|
||||
|
||||
{{% /codetab %}}
|
||||
|
||||
{{< /tabs >}}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue