-
Notifications
You must be signed in to change notification settings - Fork 25
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
work on data dispatcher #618
Conversation
Could we call this something similar to a received ARQ transfer data handler or FreeDATA handler? Data handler is maybe too generic? |
@ptsmonteiro I moved the dispatcher as suggested to the on_frame_received part. I also adjusted and splitted the dispatcher naming. Please let me know if its more clear now or if it needs further adjustments |
This comment has been minimized.
This comment has been minimized.
Yes, that's what I have been initially thinking. So it's good we are in sync now. |
'prepare': self.prepare_raw_gzip, | ||
'handle': self.handle_raw_gzip | ||
}, | ||
"p2pmsg_lzma": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking about having two layers of data. At this lower level I would only say if the arq session payload is freedata data and how to get to it (compression algorithm) OR data for another app that might use the freedata platform (other data types).
Then, at the freedata level, we could potentially have multiple types of messages (p2p, etc ..) and this would be indicated in the JSON structure inside every freedata payload.
Does this make sense to you or have we already mixed everything up and so it doesn't matter any more?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the additional data layer would make the entire system more scalable. If we are doing this at arq level and therefore inside this data handler, it would be bloated fast I think.
So one use case, one endpoint should be the direction in my opinion.
Inside message module we then can define several types with json structure. Which shouldn't be too much byte overhead because of compression. For this we could use the existing formatter with encapsulation?
@ptsmonteiro I removed the data formatter. From my side this can be reviewed again. Work on further features like a data dispatcher should be done in a separate PR for keeping work packages small and per use case. I think we can also leave the p2p related stuff inside this module as it's making data dispatching later easier and avoids additional header data for data types not message related. Sure, it's some kind of mixing layers, but I think this could simplify things a bit. If we don't like it, we can change it later the next weeks while gathering experience with this design approach |
We should do something about the failing checks. |
A class which adds a "type" information to the info frame when opening an ARQ session. It allows, dispatching data by the type or using different compression algorithms.
Transmit Example:
Receive:
--> Dispatcher will be called after a successfull ARQ transmission.
dispatched_data = self.arq_data_type_handler.dispatch(type_byte, formatted_data)
corresponding endpoints can be added in arq_data_type_handler.py