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

feat: add request callback config option #1011

Merged
merged 2 commits into from
Jan 15, 2025

Conversation

dennis-tra
Copy link
Contributor

@dennis-tra dennis-tra commented Jan 10, 2025

This pull request adds a callback hook into the stream handler and will be called on every request.

@dennis-tra dennis-tra marked this pull request as ready for review January 14, 2025 14:11
@dennis-tra dennis-tra requested review from guillaumemichel and a team as code owners January 14, 2025 14:11
@guillaumemichel
Copy link
Contributor

IIUC checking whether a field is set is cheaper than invoking an empty function. Otherwise looks good to me 👍🏻

What will be the use case of this new hook?

@dennis-tra
Copy link
Contributor Author

dennis-tra commented Jan 15, 2025

The use case is for ants-watch so that we can avoid our own fork. IIRC I'm also using a similar hook in parsec (but need to check).

Do you want me to change the code to do a nil check instead? nvmd, you already did that 👍

@guillaumemichel guillaumemichel merged commit dbb8d9e into libp2p:master Jan 15, 2025
9 checks passed
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