Skip to content

feat: add request callback config option#1011

Merged
guillaumemichel merged 2 commits intolibp2p:masterfrom
probe-lab:request-hook
Jan 15, 2025
Merged

feat: add request callback config option#1011
guillaumemichel merged 2 commits intolibp2p:masterfrom
probe-lab:request-hook

Conversation

@dennis-tra
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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 👍

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