Code Monkey home page Code Monkey logo

Comments (5)

derekperkins avatar derekperkins commented on July 24, 2024

This would only be necessary when you want to support transactions, correct? If that's the case, I can definitely get behind this.

from nds.

jongillham avatar jongillham commented on July 24, 2024

@derekperkins the issue only has the potential to arise when you are in a transaction. However the solution I propose (https://github.com/qedus/nds/tree/context) would affect the signatures of the whole API. Instead of doing nds.Get(c, key, value) you would need to do c.Get(key, value). I am guessing you would not be happy with this?

There might be a happy middle ground though where only code that runs in a transaction must change...

from nds.

derekperkins avatar derekperkins commented on July 24, 2024

Everything Google is doing is migrating towards using https://godoc.org/golang.org/x/net/context, including the appengine package. My vote would be for you to not introduce your own context, but instead use this new one and pass it through as the first parameter of the function. That's at least the most future proof way that I can think of.

I don't have a great solution for the existing appengine package though, since it doesn't have a Value function you can hook into.

from nds.

jongillham avatar jongillham commented on July 24, 2024

That is an excellent suggestion. I am going to refactor the context branch with your suggestions.

from nds.

jongillham avatar jongillham commented on July 24, 2024

Fixed in commit 2d34590.

from nds.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.