示例#1
0
func (f futureInt64) Get() (int64, error) {
	f.BlockUntilReady()

	var ver C.int64_t
	if err := C.fdb_future_get_version(f.ptr, &ver); err != 0 {
		return 0, Error{int(err)}
	}
	return int64(ver), nil
}
示例#2
0
// GetWithError returns a database version or an error if the asynchronous
// operation associated with this future did not successfully complete. The
// current goroutine will be blocked until the future is ready.
func (f FutureVersion) GetWithError() (int64, error) {
	fdb_future_block_until_ready(f.ptr)

	var ver C.int64_t
	if err := C.fdb_future_get_version(f.ptr, &ver); err != 0 {
		return 0, Error(err)
	}
	return int64(ver), nil
}