Extract core state machine to lua module #362
Merged
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.
Extracted a lot of the bios loop into BIOSStateMachine.lua as part of my warpath to remove all
dofile
calls.This removes a lot of static calls from Protocol and refactors ProtocolIO to be an instance-based connection manager. The remainder of Protocol likely have to wait until all modules are migrated.
I'm still testing to validate performance is equivalent and that everything works as expected (initial testing would indicate so, but I'd like to continue testing to be on the safe side).EDIT: In my testing, performance was effectively identical. For my tests, I incremented a counter every time we skipped sending data because we hadn't yet reached the next frame time (1/30 seconds). This happens if we're too quick, so it's generally a good thing. In my testing (on my machine), I found that both my version and the original skipped sending data 3 times between each actual send around 95% of the time. Given the behavior between each version was identical, I'm comfortable moving forward.