-
Notifications
You must be signed in to change notification settings - Fork 492
split transport from main Firebase object #70
Comments
How about something like:
This allows us to encapsulate the response parsing inside of the objects as well. I am still a little fuzzy on how stream will work if the transport is not owned by the command object though. |
So what I liked about the
And it actually close to what's happening on the wire:
|
hmm.. just seems really low level to me. The user is then responsible for managing the state of the connection (i.e. in a stream or out of a stream). They are responsible for knowing to read all responses or they may get a surprising response later on (i.e. they send a PUT then a GET, then read expecting the response to the GET). Also, without response parsing there doesn't seem to be much to this library. You still need to study the REST api to understand what to expect back. I feel our goal should be to encapsulate all of the wire protocol and webby-ness (json, urls, headers, http codes) away and provide a c-style RPC interface. You provide structured data as a input and get structured data as an output. |
So I still plan to parse the response, the I'm totally down to provide more friendly interface on top, but I just like to get this low level layer working on ESP and Linux first. |
This should be fixed with #353 |
In order to be portable across multiple IoT platform we should split the transport from the main
Firebase*
class.The core of the library would be a set of portable class for holding the db url, the credentials and building method payload.
And then there would be transport class for each platform:
A main for the curl platform could look like this:
A main for the Arduino platform could loop like this:
The text was updated successfully, but these errors were encountered: