Make pool self-contained, remove verbose logging, add MemoryPools...remove interfaces.zig(oops) #292
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.
This change was supposed to be pretty minor, but it required larger changes to the rest of the project. I'm not opposed to abandoning the changes here.
The goal was to remove the verbose logging while testing (because the new Http Client does a bit of fuzzing, so this is called a lot more) AND to make the loop self-contained, so that callers didn't have to call the onRecv, onSend and onConnect callbacks (to decrement the
events_nb).-- Unexpected breaking change #1 --
I also decided to add a MemoryPool for the ContextTimeout and ContextCancel. This caused a build failure due to an internal dependency loop. The issue is that the interfaces check requires the Loop, but I made the Loop-type dependent on the JsCallback (because it now has a MemoryPool(ContextTimeout) field which has a JsCallback. But JsCallback isn't available until the interfaces check passes!
-- Unexpected breaking change #2 --
More minor, but I removed the
unreachablefrom the code and made the functions return an error. I think we should avoid having runtime-unreachable as much as possible.-- Unknown change #1 --
Not clear if the inner IO loop had to be a pointer (
io: *IO), but I changed it toio: IO, and everything seems to work.