예제 #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
파일: futures.go 프로젝트: rayleyva/fdb-go
// 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
}