add bisync crate for async support#33
Open
omelia-iliffe wants to merge 9 commits intorobohouse-delft:mainfrom
Open
add bisync crate for async support#33omelia-iliffe wants to merge 9 commits intorobohouse-delft:mainfrom
omelia-iliffe wants to merge 9 commits intorobohouse-delft:mainfrom
Conversation
moved read_response_if_not_broadcast fn to Client
moved packet_id and instruction_id in bus mod
changed visibility of some items
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.
A (large) PR to add Async support via the bisync crate
A number of public types have moved do to needing to seperate the method calls (that need to be either async or sync) and the types they return (as you don't need special AsyncPing, AsyncResponse, ..etc types ).
I also removed some top level exports to try to separate the client and device systems more.
The bisync pattern looks like this
Instead of having one of these patterns at the top level I opted for multiple, one for Bus, Client, and Device.
The modules asynch and sync are not exported, rather opting for structs with an
Asyncprefix (ieAsyncClient)This make it clearer imo.
The pattern also requires the use of
superalot which I imagine might get tricky to maintain. Import the wrong thing withoutsuperand it might break in a hard to understand way.Otherwise, it's great! I'm using it at the moment with embassy on the esp32 and enjoying it :)