-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document Promise combinators and determinism concerns #312
Conversation
Deploying with
|
Latest commit: |
c732728
|
Status: | ✅ Deploy successful! |
Preview URL: | https://e5e97dc5.documentation-beg.pages.dev |
Branch Preview URL: | https://issue307.documentation-beg.pages.dev |
docs/services/sdk/side-effects.mdx
Outdated
Creates an Awaitable that awaits all of the provided Awaitables to resolve. | ||
|
||
**Awaitable.any():** | ||
|
||
```shell | ||
SomeResponse res = (SomeResponse) Awaitable.any(a1, a2, a3).await(); | ||
``` | ||
|
||
Creates an Awaitable that awaits any of the provided Awaitables to resolve. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can write down the the behaviour is similar to JDK's CompletableFuture.all/any
docs/services/sdk/side-effects.mdx
Outdated
**Awaitable.all():** | ||
|
||
```shell | ||
SomeResponse res = (SomeResponse) Awaitable.all(a1, a2, a3).await(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is wrong, SomeResponse returns Void.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to then do Awaitable#await
on the single awaitables (where the operation will be no-op because the value was awaited by await all)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@slinkydeveloper Can you suggest what it should be? I am not sure what you mean
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awaitable.all(a1, a2, a3).await();
SomeResponse a1Res = a1.await(); // This immediately returns value
Something like that
docs/services/sdk/side-effects.mdx
Outdated
|
||
**CombineablePromise.allSettled():** | ||
|
||
```shell |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be typescript
? same below with java?
Fixes #307
CombineablePromise.all/any/allSettled/race
for TSAwaitable.any/all
for Java