Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi @jcheng5,
This is a re-write of the persistent wait thread I had devised. I implemented the logic for nanonext in shikokuchuo/nanonext@c04c5d9 and I've ported it back here for later (as this was the original inspiration).
Main features
It covers our use case for sequential curl socket waits (streaming and non-streaming in httr2 and elmer), and is no worse for concurrent waits (which will use the same threads as before).
Substantially the same mechanism has already shipped in nanonext 1.3.1 and is being used for interruptible waits in mirai and any issues would show up right across the mirai/crew/targets stack.
It's your call whether you think the added complexity is worth it. We don't have to include this initially if you want to ship the existing implementation. This is a (substantially complete) draft but still requires some polish if you decide to go ahead with it.