Skip to content

Commit 8aca6ba

Browse files
committed
Merge branch 'release/v1.0.0'
2 parents 0d03ac5 + 342de8e commit 8aca6ba

File tree

5 files changed

+55
-13
lines changed

5 files changed

+55
-13
lines changed

Diff for: CHANGELOG.md

+6-10
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,13 @@
22
All notable changes to this project will be documented in this file.
33
This project adheres to [Semantic Versioning](http://semver.org/).
44

5-
## v1.0.0 RC3 - 2015-06-22
5+
## v1.0.0 - 2015-06-27
66

7-
### Changed
8-
- Reverted change that added sorting to maps when decoding due to performance concerts, instead documented that struct tags should be used. Especially when using a field named `Id`.
7+
1.0.0 is finally here, This is the first stable production ready release of GoRethink!
98

10-
## v1.0.0 RC2 - 2015-06-11
9+
![GoRethink Logo](https://raw.github.com/wiki/dancannon/gorethink/gopher-and-thinker.png "Golang Gopher and RethinkDB Thinker")
1110

12-
### Fixed
13-
- Fixed issue causing driver to fail when connecting to DB which did not have its canonical address set correctly (#200).
14-
15-
## v1.0.0 RC1 - 2015-06-07
16-
In an attempt to make this library more "idiomatic" some functions have been renamed, for the full list of changes see below.
11+
In an attempt to make this library more "idiomatic" some functions have been renamed, for the full list of changes and bug fixes see below.
1712

1813
### Added
1914
- Added more documentation.
@@ -38,9 +33,10 @@ In an attempt to make this library more "idiomatic" some functions have been ren
3833
- Removed depth limit when encoding values using `Expr`
3934

4035
### Fixed
41-
- Fixed issue causing inconsistent results when unmarshaling query response into structs (#192)
4236
- Fixed issue causing errors when closing a changefeed cursor (#191)
4337
- Fixed issue causing nodes to remain unhealthy when host discovery is disabled (#195)
38+
- Fixed issue causing driver to fail when connecting to DB which did not have its canonical address set correctly (#200).
39+
- Fixed ongoing queries not being properly stopped when closing the cursor.
4440

4541
### Removed
4642
- Removed `CacheSize` and `DataCenter` optional arguments in `TableCreateOpts`.

Diff for: README.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66

77
[Go](http://golang.org/) driver for [RethinkDB](http://www.rethinkdb.com/)
88

9+
![GoRethink Logo](https://raw.github.com/wiki/dancannon/gorethink/gopher-and-thinker-s.png "Golang Gopher and RethinkDB Thinker")
910

10-
Current version: v1.0.0 RC3 (RethinkDB v2.0)
11+
Current version: v1.0.0 (RethinkDB v2.0)
1112

1213
Please note that this version of the driver only supports versions of RethinkDB using the v0.4 protocol (any versions of the driver older than RethinkDB 2.0 will not work).
1314

@@ -19,6 +20,11 @@ Please note that this version of the driver only supports versions of RethinkDB
1920
go get -u github.com/dancannon/gorethink
2021
```
2122

23+
Or (pinned to the v1.x.x tag)
24+
```
25+
go get gopkg.in/dancannon/gorethink.v1
26+
```
27+
2228
## Connection
2329

2430
### Basic Connection

Diff for: cursor.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ func (c *Cursor) Close() error {
9898
}
9999

100100
// Stop any unfinished queries
101-
if c.closed == 0 && !c.finished {
101+
if !c.finished {
102102
q := Query{
103103
Type: p.Query_STOP,
104104
Token: c.token,

Diff for: doc.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Package gorethink implements a Go driver for RethinkDB
22
//
3-
// Current version: v1.0.0-rc.3 (RethinkDB v2.0)
3+
// Current version: v1.0.0 (RethinkDB v2.0)
44
// For more in depth information on how to use RethinkDB check out the API docs
55
// at http://rethinkdb.com/api
66
package gorethink

Diff for: query_table_test.go

+40
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package gorethink
22

33
import (
44
"sync"
5+
"time"
56

67
test "gopkg.in/check.v1"
78
)
@@ -213,3 +214,42 @@ func (s *RethinkSuite) TestTableChanges(c *test.C) {
213214

214215
c.Assert(n, test.Equals, 10)
215216
}
217+
218+
func (s *RethinkSuite) TestTableChangesExit(c *test.C) {
219+
DB("test").TableDrop("changes").Exec(session)
220+
DB("test").TableCreate("changes").Exec(session)
221+
222+
var n int
223+
224+
res, err := DB("test").Table("changes").Changes().Run(session)
225+
if err != nil {
226+
c.Fatal(err.Error())
227+
}
228+
c.Assert(res.Type(), test.Equals, "Feed")
229+
230+
change := make(chan ChangeResponse)
231+
232+
// Close cursor after one second
233+
go func() {
234+
<-time.After(time.Second)
235+
res.Close()
236+
}()
237+
238+
// Insert 5 docs
239+
DB("test").Table("changes").Insert(map[string]interface{}{"n": 1}).Exec(session)
240+
DB("test").Table("changes").Insert(map[string]interface{}{"n": 2}).Exec(session)
241+
DB("test").Table("changes").Insert(map[string]interface{}{"n": 3}).Exec(session)
242+
DB("test").Table("changes").Insert(map[string]interface{}{"n": 4}).Exec(session)
243+
DB("test").Table("changes").Insert(map[string]interface{}{"n": 5}).Exec(session)
244+
245+
// Listen for changes
246+
res.Listen(change)
247+
for _ = range change {
248+
n++
249+
}
250+
if res.Err() != nil {
251+
c.Fatal(res.Err())
252+
}
253+
254+
c.Assert(n, test.Equals, 5)
255+
}

0 commit comments

Comments
 (0)