Git Product home page Git Product logo

Comments (8)

jen20 avatar jen20 commented on August 27, 2024 6

I will try to contribute some worked examples of different use cases, having just spent a few hours going through the Go API this evening. No ETA though, so if someone else gets there first, then great! :-)

from foundationdb.

ezeev avatar ezeev commented on August 27, 2024

+1

from foundationdb.

congim avatar congim commented on August 27, 2024

+1

from foundationdb.

GavinYang-LR avatar GavinYang-LR commented on August 27, 2024

+1

from foundationdb.

rsrsps avatar rsrsps commented on August 27, 2024

would appreciate a watch sample. I have a fairly nice one, but it only runs for few dozen watches and then bombs with FoundationDB error code 1009 (Request for future version).

from foundationdb.

dkoston avatar dkoston commented on August 27, 2024

One thing that wasn't clear to me when starting out with FDB was that transaction timeouts are on a per-transaction basis. The docs don't set them and I think they should. Here's an example of checking whether or not a key exists w/ timeouts:

var exists bool 
keyToFind := "testing-key"

ret, err := db.Transact(func(tr fdb.Transaction) (interface{}, error) {
    tr.Options().SetTimeout(2000) // Set a 2 second timeout (you may want less)

    if tr.Get(fdb.Key(keyToFind)).MustGet() != nil {
         return true, nil
    }
    return false, nil
})

if err != nil {
    log.Printf("Error checking FDB for key: %v", err)
}

exists = ret.(bool)

from foundationdb.

ajbeamon avatar ajbeamon commented on August 27, 2024

The docs don't set them and I think they should.

See also #882

from foundationdb.

dkoston avatar dkoston commented on August 27, 2024

The docs don't set them and I think they should.

See also #882

Thanks AJ. Added a pull request to add them to the docs (at least for python and golang)

from foundationdb.

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.