Uh oh!
There was an error while loading. Please reload this page.
Refactor Transaction and Dataset into DatastoreRequest - #231
Conversation
ryanseys
commented
Sep 19, 2014
regression test |
stephenplusplus
commented
Sep 19, 2014
Just linking these together for us: #204 Thoughts so far:
Overall, I like the separation. We should make sure this structure is 👍 so that we can mimic it throughout the codebase as we go on supporting the other services. To support that goal, is there a way we could make an even more abstract varremoteStream=https.request(request,function(resp){varbuffer=newBuffer('');resp.on('data',function(chunk){buffer=Buffer.concat([buffer,chunk]);});resp.on('end',function(){util.handleResp(null,resp,buffer.toString(),function(err){if(err){cb(err);return;}cb(null,respType.decode(buffer));});});});remoteStream.on('error',cb);remoteStream.write(req.toBuffer());remoteStream.end();Something like: Any of these sub-classes can implement their own |
ryanseys
commented
Sep 22, 2014
Yes that would be ideal, to separate into a common module that can be used across all APIs. |
ryanseys
commented
Sep 27, 2014
Having any class have to create a new |
stephenplusplus
commented
Sep 27, 2014
There is still a benefit to abstracting some commonalities, such as creating streams, handling errors/responses, creating authenticated requests, etc. but it's ok to put this off for now. If we think we need to abstract later, we can revisit that then. Are there any changes you want to make to this pr or is it ready for review? |
ryanseys
commented
Sep 27, 2014
Yes. I agree. It's important to pull out the streaming stuff and some common entities but it's beyond the scope of this PR. |
ryanseys
commented
Sep 27, 2014
I changed DatastoreRequester to DatastoreRequest and fixed small transaction bug so I think this is ready for more formal review. 😄 thanks! |
stephenplusplus
commented
Sep 28, 2014
Should |
stephenplusplus
commented
Sep 28, 2014
I like it, but I think we're going to have a tough time working this into the docs. Atm, the only thing I can think of is having a new docs page for the DatastoreRequest module that is linked to from Dataset. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
stephenplusplus
commented
Sep 28, 2014
How about |
ryanseys
commented
Sep 28, 2014
sure just as long as we don't confuse it with |
stephenplusplus
commented
Sep 28, 2014
We can still name it in a way that's helpful locally, if you think something like this is better: varDatastoreRequest=require('./request.js'); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
* build: run tests on node11 * build: run tests on node11 * build: run tests on node11 * build: run tests on node11
* build: run tests on node11 * build: run tests on node11 * build: run tests on node11 * build: run tests on node11
* build: run tests on node11 * build: run tests on node11 * build: run tests on node11 * build: run tests on node11
This PR was generated using Autosynth. 🌈 Synth log will be available here: https://source.cloud.google.com/results/invocations/933ad2fd-a72d-472d-91bb-4b474e01ed77/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: googleapis/synthtool@ba9918c
…ode 8, add config files for cloud-rad (#231) This PR was generated using Autosynth. 🌈 Synth log will be available here: https://source.cloud.google.com/results/invocations/5b03461e-47c0-40e8-a8ad-c465ee146cc5/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: googleapis/synthtool@21f1470 Source-Link: googleapis/synthtool@388e10f Source-Link: googleapis/synthtool@d82decc
…ode 8, add config files for cloud-rad (#231) This PR was generated using Autosynth. 🌈 Synth log will be available here: https://source.cloud.google.com/results/invocations/5b03461e-47c0-40e8-a8ad-c465ee146cc5/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: googleapis/synthtool@21f1470 Source-Link: googleapis/synthtool@388e10f Source-Link: googleapis/synthtool@d82decc
…ncy versions (#231) This PR was generated using Autosynth. 🌈 Synth log will be available here: https://source.cloud.google.com/results/invocations/a1c25589-9aeb-49f0-922e-4037066a83df/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: googleapis/synthtool@fdd03c1
…ncy versions (#231) This PR was generated using Autosynth. 🌈 Synth log will be available here: https://source.cloud.google.com/results/invocations/a1c25589-9aeb-49f0-922e-4037066a83df/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: googleapis/synthtool@fdd03c1
Might be missing documentation in a few areas because I wanted to get the structural changes out first before we refine it.
Separates the request logic out from Dataset and Transaction into a
DatastoreRequesterwhich probably isn't the best name but can be refactored as well. Feel free to send suggestions.