Skip to content

Add notification to the middleware of peer removal.#573

Open
tmiv wants to merge 2 commits intoionorg:masterfrom
tmiv:feature/dc_middleware_notify_peer_removal
Open

Add notification to the middleware of peer removal.#573
tmiv wants to merge 2 commits intoionorg:masterfrom
tmiv:feature/dc_middleware_notify_peer_removal

Conversation

@tmiv
Copy link
Contributor

@tmiv tmiv commented Aug 22, 2021

Description

This change allows data channel middleware to register a callback for when a peer disconnects.

Reference issue

Fixes #572

@codecov
Copy link

codecov bot commented Aug 22, 2021

Codecov Report

Merging #573 (27905a4) into master (d7b670b) will decrease coverage by 0.11%.
The diff coverage is 0.00%.

❗ Current head 27905a4 differs from pull request most recent head 253755f. Consider uploading reports for the commit 253755f to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master     #573      +/-   ##
==========================================
- Coverage   36.26%   36.15%   -0.12%     
==========================================
  Files          25       25              
  Lines        2647     2650       +3     
==========================================
- Hits          960      958       -2     
- Misses       1555     1559       +4     
- Partials      132      133       +1     
Impacted Files Coverage Δ
pkg/sfu/datachannel.go 30.76% <0.00%> (-2.57%) ⬇️
pkg/sfu/subscriber.go 58.22% <0.00%> (-0.75%) ⬇️
pkg/sfu/router.go 46.82% <0.00%> (-1.16%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d7b670b...253755f. Read the comment docs.

@OrlandoCo
Copy link
Collaborator

Hey @tmiv sorry for late response, but is necessary to put the callback on the datachannel?, should Peer be a better location for a close callback?

@tmiv
Copy link
Contributor Author

tmiv commented Aug 31, 2021

No @OrlandoCo, I don't think so. It's the middleware who should process the disconnect (onRemovePeer). Just as the middleware processes the messages (onMessage). But I think that I might be convoluting the concept of a dc middleware here. It seems that data channel can have more than one middleware thus the DC chain structure. Also, that the concept of a middleware is really just a single function.

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.

Datachannel middleware notification of Peer dropping.

2 participants