Request reusability and some upgrades - #16
Open
brosenfi wants to merge 1 commit into
Open
Conversation
…VE-2020-25573 in linked-hash-map pointed at by serde-hjson) and for general uplift. Also, made the request reusable while still maintaining the consumption pattern of infer_async through use of a new request inner. Finally, fixed a couple of misspellings.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 PR is primarily about request reusability which was not previously available since the request was entirely consumed outside of the input buffers. In this update, there is a request release that is returned independently from the response future that is used to retrieve the request after release - the input buffers can now be retrieved from the released request. A request inner struct had to be created and a server argument added to infer_async in order to allow the existing request consumption pattern (now consuming just the outer shell of the request) while satisfying the borrow checker and still maintaining the lifespan being tied to the server instance. An example of the re-use has been added to README.md:
Note in the documented simple example of triton C-API use, it appears to me the request release futures are only awaited after the output futures are awaited - not sure this implies what the order is however - the futures in this PR are returned independently which I believe matches the previous pattern of getting the response future then immediately taking the input release. Lastly on the request reusability - the allocator is documented as a single use construct in this crate - therefore I continued this pattern and it's consumed (also with the trace - both must be reset on the request to use) - but the simple C-API example shows it as being reusable as well (would need an upgrade to do that in this crate).
I also made a couple of smaller changes:
This is the PR I mentioned I would open in this issue .