-
Notifications
You must be signed in to change notification settings - Fork 41
Allow joining FETCH for PUBLISH and SUBSCRIBE_UPDATE forward=1 #1335
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
Open
afrind
wants to merge
2
commits into
main
Choose a base branch
from
afrind-pub-joining-fetch
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -912,11 +912,6 @@ a SUBSCRIBE. A subscriber MUST send exactly one PUBLISH_OK or REQUEST_ERROR in | |
| response to a PUBLISH. The peer SHOULD close the session with a protocol error | ||
| if it receives more than one. | ||
|
|
||
| A publisher MUST save the Largest Location communicated in PUBLISH or | ||
| SUBSCRIBE_OK when establishing a subscription. This value can be used in a | ||
| Joining FETCH (see {{joining-fetches}}) at any time while the subscription is | ||
| active. | ||
|
|
||
| All `Established` subscriptions have a Forward State which is either 0 or 1. If the Forward | ||
| State is 0, the publisher does not send objects for the subscription. If the | ||
| Forward State is 1, the publisher sends objects. The initiator of the | ||
|
|
@@ -926,6 +921,12 @@ the subscription is established, the subscriber can update the Forward State by | |
| sending SUBSCRIBE_UPDATE. Control messages, such as PUBLISH_DONE | ||
| ({{message-publish-done}}) are still sent on subscriptions in Forward State 0. | ||
|
|
||
| A publisher MUST save the Largest Location communicated in SUBSCRIBE_OK, PUBLISH | ||
| or REQUEST_OK in response to a SUBSCRIBE_UPDATE that changes the Forward State | ||
| from 0 to 1. This value is called the Joining Location and can be used in a | ||
| Joining FETCH (see {{joining-fetches}}) while the subscription is in the | ||
| `Established` state. | ||
|
|
||
| Either endpoint can initiate a subscription to a track without exchanging any | ||
| prior messages other than SETUP. Relays MUST NOT send any PUBLISH messages | ||
| without knowing the client is interested in and authorized to receive the | ||
|
|
@@ -1033,7 +1034,7 @@ is a join point, so in order for a subscriber to join a Track, it needs to | |
| request an existing Group or wait for a future Group. Different applications | ||
| will have different approaches for when to begin a new Group. | ||
|
|
||
| To join a Track at a past Group, the subscriber sends a SUBSCRIBE with Filter | ||
| To join a Track at a past Group, the subscriber sends a SUBSCRIBE, PUBLISH_OK or SUBSCRIBE_UPDATE with Filter | ||
| Type `Largest Object` followed by a Joining FETCH (see {{joining-fetches}}) for | ||
| the intended start Group, which can be relative. To join a Track at the next | ||
| Group, the subscriber sends a SUBSCRIBE with Filter Type `Next Group Start`. | ||
|
|
@@ -2630,23 +2631,22 @@ Standalone Fetch { | |
|
|
||
| ### Joining Fetches | ||
|
|
||
| A Joining Fetch is associated with a Subscribe request by | ||
| specifying the Request ID of an `Established` subscription. | ||
| A Joining Fetch is associated with an `Established` subscription by | ||
| specifying its Request ID. | ||
| A publisher receiving a Joining Fetch uses properties of the associated | ||
| Subscribe to determine the Track Namespace, Track Name | ||
| subscription to determine the Track Namespace, Track Name | ||
| and End Location such that it is contiguous with the associated | ||
| Subscribe. The subscriber can set the Start Location to an absolute Location or | ||
| a Location relative to the current group. | ||
| subscription. The subscriber can set the Start Location to an absolute Location or | ||
| a Location relative to the Largest group. | ||
|
|
||
| A Subscriber can use a Joining Fetch to, for example, fill a playback buffer with a | ||
| certain number of groups prior to the live edge of a track. | ||
|
|
||
| A Joining Fetch is only permitted when the associated Subscribe has the Filter | ||
| Type Largest Object; any other value results in closing the session with a | ||
| `PROTOCOL_VIOLATION`. | ||
| A Joining Fetch is only permitted when the associated subscription Filter | ||
| Type is Largest Object and the Forward State is 1; any other value results in closing | ||
| the session with a `PROTOCOL_VIOLATION`. | ||
|
|
||
| If no Objects have been published for the track, and the SUBSCRIBE_OK did not | ||
| include a LARGEST_OBJECT parameter ({{largest-param}}), the publisher MUST | ||
| If no Objects have been published for the track the publisher MUST | ||
| respond with a REQUEST_ERROR with error code `INVALID_RANGE`. | ||
|
|
||
| A Joining Fetch includes this structure: | ||
|
|
@@ -2658,30 +2658,29 @@ Joining Fetch { | |
| } | ||
| ~~~ | ||
|
|
||
| * Joining Request ID: The Request ID of the existing subscription to be | ||
| * Joining Request ID: The Request ID of the `Established` subscription to be | ||
| joined. If a publisher receives a Joining Fetch with a Request ID that does | ||
| not correspond to an existing Subscribe in the same session, it MUST return | ||
| not correspond to an `Established` subscription in the same session, it MUST return | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Some other states are valid.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed in #1363 |
||
| a REQUEST_ERROR with error code `INVALID_JOINING_REQUEST_ID` | ||
|
|
||
| * Joining Start : A relative or absolute value used to determing the Start | ||
| Location, described below. | ||
|
|
||
| #### Joining Fetch Range Calculation | ||
|
|
||
| The Largest Location value from the corresponding | ||
| The Joining Location value from the corresponding | ||
| subscription is used to calculate the end of a Joining Fetch, so the | ||
| Objects retrieved by the FETCH and SUBSCRIBE are contiguous and non-overlapping. | ||
|
|
||
| The publisher receiving a Joining Fetch sets the End Location to {Subscribe | ||
| Largest Location.Object + 1}. Here Subscribe Largest Location is the | ||
| saved value from when the subscription started (see {{subscriptions}}). | ||
| The publisher receiving a Joining Fetch sets the End Location to | ||
| {Joining Location.Group, Joining Location.Object + 1} (see {{subscriptions}}. | ||
|
|
||
| Note: the last Object included in the Joining FETCH response is Subscribe | ||
| Largest Location. The `+ 1` above indicates the equivalent Standalone Fetch | ||
| Note: the last Object included in the Joining FETCH response is Joining | ||
| Location. The `+ 1` above indicates the equivalent Standalone Fetch | ||
| encoding. | ||
afrind marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| For a Relative Joining Fetch, the publisher sets the Start Location to | ||
| {Subscribe Largest Location.Group - Joining Start, 0}. | ||
| {Joining Location.Group - Joining Start, 0}. | ||
|
|
||
| For an Absolute Joining Fetch, the publisher sets the Start Location to | ||
| {Joining Start, 0}. | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.