Skip to content

relay: add CrossExecForwarderCallback#330

Merged
afrind merged 1 commit into
mainfrom
pr330
May 25, 2026
Merged

relay: add CrossExecForwarderCallback#330
afrind merged 1 commit into
mainfrom
pr330

Conversation

@afrind
Copy link
Copy Markdown
Contributor

@afrind afrind commented May 25, 2026

Dispatches MoQForwarder::Callback (onEmpty, forwardChanged,
newGroupRequested) to a target executor fire-and-forget. Locks the
weak_ptr on the calling thread — where the forwarder is guaranteed
alive — and moves the resulting shared_ptr into the lambda to keep it
alive across the executor hop without forming a permanent ownership
cycle (forwarder → callback → forwarder).

The weak_ptr member avoids that permanent cycle; eager locking at
call-site ensures the lambda always has a valid pointer to deliver.


This change is Reviewable

Copy link
Copy Markdown
Contributor

@gmarzot gmarzot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gmarzot reviewed 3 files and all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on akash-a-n, michalhosna, mondain, Oxyd, peterchave, suhasHere, and TimEvens).

@afrind afrind force-pushed the pr329 branch 3 times, most recently from c80d25c to 036df59 Compare May 25, 2026 19:37
Base automatically changed from pr329 to main May 25, 2026 20:02
Dispatches MoQForwarder::Callback (onEmpty, forwardChanged,
newGroupRequested) to a target executor fire-and-forget. Locks the
weak_ptr on the calling thread — where the forwarder is guaranteed
alive — and moves the resulting shared_ptr into the lambda to keep it
alive across the executor hop without forming a permanent ownership
cycle (forwarder → callback → forwarder).

The weak_ptr member avoids that permanent cycle; eager locking at
call-site ensures the lambda always has a valid pointer to deliver.
@afrind afrind merged commit 32d1070 into main May 25, 2026
27 of 32 checks passed
@afrind afrind deleted the pr330 branch May 25, 2026 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants