Skip to content
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

Use Consumer interface for MoQSession reads #13

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

afrind
Copy link
Contributor

@afrind afrind commented Dec 19, 2024

Summary:
This is the second half of the MoQSession rewrite. subscribe and fetch callers now supply a Consumer which the library drives as a callback.

To make the consumer API work required changing the codec callbacks.

The relay now connects a Forwarder (Consumer) to the upstream subscription directly.

Differential Revision: D66881617

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Meta Open Source bot. label Dec 19, 2024
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D66881617

afrind added a commit to afrind/moxygen that referenced this pull request Dec 19, 2024
Summary:

This is the second half of the MoQSession rewrite. subscribe and fetch callers now supply a Consumer which the library drives as a callback.

To make the consumer API work required changing the codec callbacks.

The relay now connects a Forwarder (Consumer) to the upstream subscription directly.

Differential Revision: D66881617
Summary:
This is a major rewrite of MoQSession using the new Consumers interfaces.  It's separated into the writes (this diff) and reads (next diff).

Note the relay -- which does writes and reads -- is slightly broken in this diff but fixed in the next, so don't read too much into it.

The previous "publish" API required the session to maintain a huge map of every currently open stream across the session and perform lookups into this map in order to do the writes.  It also had a number API error cases that could be eliminated by constraining the interface.

Now subscribeOK and fetchOK return a Consumer object which the publisher will use to pass track data according to those APIs.  No maps are required -- the publisher hangs onto the handle(s) it needs to publish.

MoQForwarder also had a major rewrite.  It conveniently now implements the TrackConsumer interface as well, so a publisher can trivially publish to one or N subscribers.

Differential Revision: D66881597
Summary:
Pull Request resolved: facebookexperimental#13

This is the second half of the MoQSession rewrite. subscribe and fetch callers now supply a Consumer which the library drives as a callback.

To make the consumer API work required changing the codec callbacks.

The relay now connects a Forwarder (Consumer) to the upstream subscription directly.

Differential Revision: D66881617
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D66881617

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Meta Open Source bot. fb-exported
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants