Skip to content

Commit

Permalink
Merge pull request #534 from nidhijaju/reject-promise-pull-algorithm
Browse files Browse the repository at this point in the history
Reject promise if state is not "connected" in pull(Uni|Bi)directionalStream
  • Loading branch information
jan-ivar committed Aug 15, 2023
2 parents b6eef8f + cb47259 commit 26f9867
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -861,6 +861,8 @@ these steps.
1. If |transport|.{{[[State]]}} is `"connecting"`, then return the result of performing the
following steps [=upon fulfillment=] of |transport|.{{[[Ready]]}}:
1. Return the result of [=pullBidirectionalStream=] with |transport|.
1. If |transport|.{{[[State]]}} is not `"connected"`, then return a new [=rejected=] promise with
an {{InvalidStateError}}.
1. Let |session| be |transport|.{{[[Session]]}}.
1. Let |p| be a new promise.
1. Run the following steps [=in parallel=]:
Expand All @@ -883,6 +885,8 @@ these steps.
1. If |transport|.{{[[State]]}} is `"connecting"`, then return the result of performing the
following steps [=upon fulfillment=] of |transport|.{{[[Ready]]}}:
1. Return the result of [=pullUnidirectionalStream=] with |transport|.
1. If |transport|.{{[[State]]}} is not `"connected"`, then return a new [=rejected=] promise with
an {{InvalidStateError}}.
1. Let |session| be |transport|.{{[[Session]]}}.
1. Let |p| be a new promise.
1. Run the following steps [=in parallel=]:
Expand Down

0 comments on commit 26f9867

Please sign in to comment.