-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FC43 Frame Writer and Improvements #142
Open
grewek
wants to merge
42
commits into
stepfunc:iware/review
Choose a base branch
from
grewek:feature/fc43-iprovements-new
base: iware/review
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
FC43 Frame Writer and Improvements #142
grewek
wants to merge
42
commits into
stepfunc:iware/review
from
grewek:feature/fc43-iprovements-new
Conversation
This file contains 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.
Hello Adam,
I finally had some time to make the needed changes to the FC43, in this preliminary pull request you can find more information about all the changes I made.
I made a change to the frame's trait, it now gets a “FrameRecorder” in addition to its other arguments, which is used to remember positions in the buffer and fill them at a later time. See:
3c144b3 (changes on the serialize trait)
The “FrameRecoder” is actually just a HashMap that stores a position within the underlying buffer, ensuring that all recorded positions are filled in with the necessary information by the user until shortly before the message is sent. If the user has forgotten to fill in the required information, this is intercepted by a new error “FrameRecorderNotEmpty” which I have added to the RequestError enum.
Commits:
274399f (The basic frame recoder from a few months ago)
1b401bf (Usage of the frame recorder)
8b085f2 (new error enum for the frame recoder)
488e085 (checks to make sure that the frame recoder is indeed empty)
049e7ea (ffi error conversion for the frame recoder)
The whole thing works quite well so far, but I still need to write some tests to be really sure. I also see some things we should clarify before I continue.
Are there any performance concerns from your side because of the hashmap? I think I heard that the implementation in the standard library of Rust is not the fastest.
At the moment I rewind the cursor(seek_to()) when the user wants to fill in a stored value. Then I set it back to the position where it was before the fill_record() method was called. Is there any detail I may have overlooked that speaks against this particular use of the cursor?
I am currently using strings as keys in the hashmap of the recorder, here too I am unsure about the performance, the strings make it relatively easy to find the desired positions later on!