Skip to content

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 a team and guillaumemichel as code owners January 14, 2025 14:11
@guillaumemichel
Copy link
Collaborator

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