Skip to content

Commit 87cd2c0

Browse files
OrKoNjgraham
andauthored
Recover subscriptions by module name (#843)
* recover module events * Recover subscriptions by module name * Update index.bs Co-authored-by: jgraham <[email protected]> * Update index.bs Co-authored-by: jgraham <[email protected]> --------- Co-authored-by: jgraham <[email protected]>
1 parent c095b38 commit 87cd2c0

File tree

1 file changed

+33
-2
lines changed

1 file changed

+33
-2
lines changed

index.bs

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -789,6 +789,29 @@ given |event name| and |session| is:
789789

790790
</div>
791791

792+
<div algorithm>
793+
To <dfn>obtain a set of event names</dfn> given a |name|:
794+
795+
1. Let |events| be an empty [=/set=].
796+
797+
1. If |name| contains a U+002E (period):
798+
799+
1. If |name| is the [=event name=] for an event, append |name| to |events|
800+
and return [=success=] with data |events|.
801+
802+
1. Return an [=error=] with [=error code=] [=invalid argument=]
803+
804+
1. Otherwise |name| is interpreted as representing all the events in a
805+
module. If |name| is not a [=module name=] return an [=error=] with
806+
[=error code=] [=invalid argument=].
807+
808+
1. Append the [=event name=] for each [=event=] in the module with name |name| to
809+
|events|.
810+
811+
1. Return [=success=] with data |events|.
812+
813+
</div>
814+
792815
# Transport # {#transport}
793816

794817
Message transport is provided using the WebSocket protocol.
@@ -1897,7 +1920,11 @@ Issue: This needs to be generalized to work with realms too.
18971920
<div algorithm="remote end steps for session.subscribe">
18981921
The [=remote end steps=] with |session| and |command parameters| are:
18991922

1900-
1. Let the |event names| be [=set/create|create a set=] with |command parameters|["<code>events</code>"].
1923+
1. Let |event names| be an empty [=/set=].
1924+
1925+
1. For each entry |name| in |command parameters|["<code>events</code>"],
1926+
let |event names| be the [=set/union=] of |event names| and the result of
1927+
[=trying=] to [=obtain a set of event names=] with |name|.
19011928

19021929
1. Let |subscription navigables| be a [=/set=].
19031930

@@ -2001,7 +2028,11 @@ The [=remote end steps=] with |session| and |command parameters| are:
20012028

20022029
1. If |command parameters| matches the <code>session.UnsubscribeByAttributesRequest</code> production:
20032030

2004-
1. Let |event names| be [=set/create|create a set=] with |command parameters|["<code>events</code>"].
2031+
1. Let |event names| be an empty [=/set=].
2032+
2033+
1. For each entry |name| in |command parameters|["<code>events</code>"],
2034+
let |event names| be the [=set/union=] of |event names| and the result of
2035+
[=trying=] to [=obtain a set of event names=] with |name|.
20052036

20062037
1. Let |top-level traversable context ids| be a [=/set=].
20072038

0 commit comments

Comments
 (0)