add js limitation

Signed-off-by: Hannah Hunter <hannahhunter@microsoft.com>
This commit is contained in:
Hannah Hunter 2024-02-05 16:52:48 -05:00
parent 7f45c9a8eb
commit 3018badb59
1 changed files with 14 additions and 17 deletions

View File

@ -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 >}}