-
Notifications
You must be signed in to change notification settings - Fork 550
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
Reduce the number of layers our commands go through #9
Comments
One negative aspect of the current system is that some logic is happening in |
I agree that the current way of doing things is easy to lose yourself in. Could you try to explain again what design would you prefer? I didn't quite understand what you meant. |
I'd prefer us to get rid of both
We'd do something like this:
I know, that might not be the hottest piece of code in the town, but at least it can do multiple requests before asking for results. |
Casts are gonna be fine, but Calls syntax is a bit too heavy. I'll think if I can find a good solution that would still reduce the number of layers but would not complicate the syntax too much. |
Reasons why we need to keep
|
Thus, since |
Solving #60 will help with layers. |
Updated to implement Factory
Remove use of removed handle typedefs
Here are the current stops in a one-way trip of a client command:
render::Client::do_something()
creates aCast
orCall
message and sends it through the piperender::Server
receives the message and calls some thedevice::Client
methodsdevice::Client:::do_something()
creates a message and sends it down the pipedevice::Server
receives the message and calls some of the back-end methodsYou can see there are 5 layers of execution... While we certainly need abstraction, we'd be fine with just 2 - 3 layers. I propose to remove
device::Client
methods in favor ofrender
just sending messages directly. We can also remove therender::Client
in favor of pure messages.(+) less code for us to maintain, less layers to loose yourself in
(+) exposing asynchronous nature actually allows to benefit from it, i.e. send a bunch of commands and then receive some (instead of send-receive cycles)
(-) less convenient for the client (the problem does not apply to device <-> render interaction)
The text was updated successfully, but these errors were encountered: