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:
|
For example, instead of this:
|
||||||
|
|
||||||
{{< tabs JavaScript ".NET" Java >}}
|
{{< tabs ".NET" Java JavaScript >}}
|
||||||
|
|
||||||
{{% codetab %}}
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
// DON'T DO THIS!
|
|
||||||
```
|
|
||||||
{{% /codetab %}}
|
|
||||||
|
|
||||||
{{% codetab %}}
|
{{% codetab %}}
|
||||||
|
|
||||||
|
@ -364,19 +357,17 @@ ctx.createTimer(Duration.ofSeconds(5)).await();
|
||||||
|
|
||||||
{{% /codetab %}}
|
{{% /codetab %}}
|
||||||
|
|
||||||
|
{{% codetab %}}
|
||||||
|
|
||||||
|
Don't declare JavaScript workflow as `async`. The Node.js runtime doesn't guarantee that asynchronous functions are deterministic.
|
||||||
|
|
||||||
|
{{% /codetab %}}
|
||||||
|
|
||||||
{{< /tabs >}}
|
{{< /tabs >}}
|
||||||
|
|
||||||
Do this:
|
Do this:
|
||||||
|
|
||||||
{{< tabs JavaScript ".NET" Java >}}
|
{{< tabs ".NET" Java JavaScript >}}
|
||||||
|
|
||||||
{{% codetab %}}
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
// Do this!!
|
|
||||||
```
|
|
||||||
|
|
||||||
{{% /codetab %}}
|
|
||||||
|
|
||||||
{{% codetab %}}
|
{{% codetab %}}
|
||||||
|
|
||||||
|
@ -398,6 +389,12 @@ ctx.createTimer(Duration.ofSeconds(5)).await();
|
||||||
|
|
||||||
{{% /codetab %}}
|
{{% /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 >}}
|
{{< /tabs >}}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue