Skip to content
This repository was archived by the owner on Apr 28, 2020. It is now read-only.

Commit 3e5e037

Browse files
committed
temp replace directive to fix: mediocregopher#184
1 parent a869bb2 commit 3e5e037

26 files changed

+57
-152
lines changed

README.md

+7-108
Original file line numberDiff line numberDiff line change
@@ -1,117 +1,16 @@
11
# Radix
22

3-
[![Build Status](https://travis-ci.org/mediocregopher/radix.svg)](https://travis-ci.org/mediocregopher/radix)
4-
![GitHub tag (latest SemVer)](https://img.shields.io/github/tag/mediocregopher/radix.svg)
5-
[![GoDoc](https://godoc.org/github.com/mediocregopher/radix?status.svg)][godoc]
6-
[![Go Report Card](https://goreportcard.com/badge/github.com/mediocregopher/radix/v3)](https://goreportcard.com/report/github.com/mediocregopher/radix/v3)
3+
[![Build Status](https://travis-ci.org/neffos-contrib/radix.svg)](https://travis-ci.org/neffos-contrib/radix)
4+
![GitHub tag (latest SemVer)](https://img.shields.io/github/tag/neffos-contrib/radix.svg)
5+
[![GoDoc](https://godoc.org/github.com/neffos-contrib/radix?status.svg)][godoc]
6+
[![Go Report Card](https://goreportcard.com/badge/github.com/neffos-contrib/radix/v3)](https://goreportcard.com/report/github.com/neffos-contrib/radix/v3)
77

88
Radix is a full-featured [Redis][redis] client for Go. See the [GoDoc][godoc]
99
for documentation and general usage examples.
1010

11-
This is the third revision of this project, the previous one has been deprecated
12-
but can be found [here](https://github.com/mediocregopher/radix.v2).
11+
## neffos-contrib
1312

14-
## Features
15-
16-
* Standard print-like API which supports all current and future redis commands.
17-
18-
* Support for using an io.Reader as a command argument and writing responses to
19-
an io.Writer, as well as marshaling/unmarshaling command arguments from
20-
structs.
21-
22-
* Connection pooling, which takes advantage of implicit pipelining to reduce
23-
system calls.
24-
25-
* Helpers for [EVAL][eval], [SCAN][scan], and manual [pipelining][pipelining].
26-
27-
* Support for [pubsub][pubsub], as well as persistent pubsub wherein if a
28-
connection is lost a new one transparently replaces it.
29-
30-
* Full support for [sentinel][sentinel] and [cluster][cluster].
31-
32-
* Nearly all important types are interfaces, allowing for custom implementations
33-
of nearly anything.
34-
35-
## Installation and Usage
36-
37-
Radix always aims to support the most recent two versions of go, and is likely
38-
to support others prior to those two.
39-
40-
[Module][module]-aware mode:
41-
42-
go get github.com/mediocregopher/radix/v3
43-
// import github.com/mediocregopher/radix/v3
44-
45-
Legacy GOPATH mode:
46-
47-
go get github.com/mediocregopher/radix
48-
// import github.com/mediocregopher/radix
49-
50-
## Testing
51-
52-
# requires a redis server running on 127.0.0.1:6379
53-
go test github.com/mediocregopher/radix/v3
54-
55-
## Benchmarks
56-
57-
Thanks to a huge amount of work put in by @nussjustin, and inspiration from the
58-
[redispipe][redispipe] project and @funny-falcon, radix/v3 is significantly
59-
faster than most redis drivers, including redigo, for normal parallel workloads,
60-
and is pretty comparable for serial workloads.
61-
62-
Benchmarks can be run from the bench folder. The following results were obtained
63-
by running the benchmarks with `-cpu` set to 32 and 64, on a 32 core machine,
64-
with the redis server on a separate machine. See [this thread][bench_thread]
65-
for more details.
66-
67-
Some of radix's results are not included below because they use a non-default
68-
configuration.
69-
70-
[bench_thread]: https://github.com/mediocregopher/radix/issues/67#issuecomment-465060960
71-
72-
73-
```
74-
# go get rsc.io/benchstat
75-
# cd bench
76-
# go test -v -run=XXX -bench=ParallelGetSet -cpu 32 -cpu 64 -benchmem . >/tmp/radix.stat
77-
# benchstat radix.stat
78-
name time/op
79-
ParallelGetSet/radix/default-32 2.15µs ± 0% <--- The good stuff
80-
ParallelGetSet/radix/default-64 2.05µs ± 0% <--- The better stuff
81-
ParallelGetSet/redigo-32 27.9µs ± 0%
82-
ParallelGetSet/redigo-64 28.5µs ± 0%
83-
ParallelGetSet/redispipe-32 2.02µs ± 0%
84-
ParallelGetSet/redispipe-64 1.71µs ± 0%
85-
86-
name alloc/op
87-
ParallelGetSet/radix/default-32 72.0B ± 0%
88-
ParallelGetSet/radix/default-64 84.0B ± 0%
89-
ParallelGetSet/redigo-32 119B ± 0%
90-
ParallelGetSet/redigo-64 120B ± 0%
91-
ParallelGetSet/redispipe-32 168B ± 0%
92-
ParallelGetSet/redispipe-64 172B ± 0%
93-
94-
name allocs/op
95-
ParallelGetSet/radix/default-32 4.00 ± 0%
96-
ParallelGetSet/radix/default-64 4.00 ± 0%
97-
ParallelGetSet/redigo-32 6.00 ± 0%
98-
ParallelGetSet/redigo-64 6.00 ± 0%
99-
ParallelGetSet/redispipe-32 8.00 ± 0%
100-
ParallelGetSet/redispipe-64 8.00 ± 0%
101-
```
102-
103-
## Copyright and licensing
104-
105-
Unless otherwise noted, the source files are distributed under the *MIT License*
106-
found in the LICENSE.txt file.
13+
Contains temporarily fix for: https://github.com/mediocregopher/radix/issues/184. The import path of [neffos/stackexchange/redis](https://github.com/kataras/neffos/blob/master/stackexchange/redis/stackexchange_redis.go) didn't change, instead we use the [replace directive](https://github.com/golang/go/wiki/Modules#when-should-i-use-the-replace-directive) of the [go.mod](https://github.com/kataras/neffos/blob/master/go.mod#L5) file.
10714

10815
[redis]: http://redis.io
109-
[godoc]: https://godoc.org/github.com/mediocregopher/radix
110-
[eval]: https://redis.io/commands/eval
111-
[scan]: https://redis.io/commands/scan
112-
[pipelining]: https://redis.io/topics/pipelining
113-
[pubsub]: https://redis.io/topics/pubsub
114-
[sentinel]: http://redis.io/topics/sentinel
115-
[cluster]: http://redis.io/topics/cluster-spec
116-
[module]: https://github.com/golang/go/wiki/Modules
117-
[redispipe]: https://github.com/joomcode/redispipe
16+
[godoc]: https://godoc.org/github.com/neffos-contrib/radix

action.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ import (
1111
"strings"
1212
"sync"
1313

14-
"github.com/mediocregopher/radix/v3/resp"
15-
"github.com/mediocregopher/radix/v3/resp/resp2"
14+
"github.com/neffos-contrib/radix/v3/resp"
15+
"github.com/neffos-contrib/radix/v3/resp/resp2"
1616
)
1717

1818
// Action performs a task using a Conn.

action_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
"github.com/stretchr/testify/assert"
1010
"github.com/stretchr/testify/require"
1111

12-
"github.com/mediocregopher/radix/v3/resp/resp2"
12+
"github.com/neffos-contrib/radix/v3/resp/resp2"
1313
)
1414

1515
func TestCmdAction(t *T) {

bench/bench_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
redigo "github.com/gomodule/redigo/redis"
1313
redispipe "github.com/joomcode/redispipe/redis"
1414
redispipeconn "github.com/joomcode/redispipe/redisconn"
15-
"github.com/mediocregopher/radix/v3"
15+
"github.com/neffos-contrib/radix/v3"
1616
)
1717

1818
func newRedigo() redigo.Conn {

bench/go.mod

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
module github.com/mediocregopher/radix/bench
1+
module github.com/neffos-contrib/radix/bench
22

33
require (
44
github.com/garyburd/redigo v1.6.0 // indirect
55
github.com/gomodule/redigo v2.0.0+incompatible
66
github.com/joomcode/errorx v0.8.0 // indirect
77
github.com/joomcode/redispipe v0.9.0
8-
github.com/mediocregopher/radix.v2 v0.0.0-20181115013041-b67df6e626f9 // indirect
9-
github.com/mediocregopher/radix/v3 v3.2.0
8+
github.com/neffos-contrib/radix.v2 v0.0.0-20181115013041-b67df6e626f9 // indirect
9+
github.com/neffos-contrib/radix/v3 v3.2.0
1010
)
1111

12-
replace github.com/mediocregopher/radix/v3 => ../.
12+
replace github.com/neffos-contrib/radix/v3 => ../.

bench/go.sum

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ github.com/joomcode/errorx v0.8.0 h1:GhAqPtcYuo1O7TOIbtzEIDzPGQ3SrKJ3tdjXNmUtDNo
88
github.com/joomcode/errorx v0.8.0/go.mod h1:kgco15ekB6cs+4Xjzo7SPeXzx38PbJzBwbnu9qfVNHQ=
99
github.com/joomcode/redispipe v0.9.0 h1:NukwwIvxhg6r2lVxa1RJhEZXYPZZF/OX9WZJk+2cK1Q=
1010
github.com/joomcode/redispipe v0.9.0/go.mod h1:4S/gpBCZ62pB/3+XLNWDH7jQnB0vxmpddAMBva2adpM=
11-
github.com/mediocregopher/mediocre-go-lib v0.0.0-20181029021733-cb65787f37ed h1:3dQJqqDouawQgl3gBE1PNHKFkJYGEuFb1DbSlaxdosE=
12-
github.com/mediocregopher/mediocre-go-lib v0.0.0-20181029021733-cb65787f37ed/go.mod h1:dSsfyI2zABAdhcbvkXqgxOxrCsbYeHCPgrZkku60dSg=
13-
github.com/mediocregopher/radix.v2 v0.0.0-20181115013041-b67df6e626f9 h1:ViNuGS149jgnttqhc6XQNPwdupEMBXqCx9wtlW7P3sA=
14-
github.com/mediocregopher/radix.v2 v0.0.0-20181115013041-b67df6e626f9/go.mod h1:fLRUbhbSd5Px2yKUaGYYPltlyxi1guJz1vCmo1RQL50=
11+
github.com/neffos-contrib/mediocre-go-lib v0.0.0-20181029021733-cb65787f37ed h1:3dQJqqDouawQgl3gBE1PNHKFkJYGEuFb1DbSlaxdosE=
12+
github.com/neffos-contrib/mediocre-go-lib v0.0.0-20181029021733-cb65787f37ed/go.mod h1:dSsfyI2zABAdhcbvkXqgxOxrCsbYeHCPgrZkku60dSg=
13+
github.com/neffos-contrib/radix.v2 v0.0.0-20181115013041-b67df6e626f9 h1:ViNuGS149jgnttqhc6XQNPwdupEMBXqCx9wtlW7P3sA=
14+
github.com/neffos-contrib/radix.v2 v0.0.0-20181115013041-b67df6e626f9/go.mod h1:fLRUbhbSd5Px2yKUaGYYPltlyxi1guJz1vCmo1RQL50=
1515
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
1616
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
1717
github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w=

cluster.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ import (
99

1010
errors "golang.org/x/xerrors"
1111

12-
"github.com/mediocregopher/radix/v3/resp"
13-
"github.com/mediocregopher/radix/v3/resp/resp2"
14-
"github.com/mediocregopher/radix/v3/trace"
12+
"github.com/neffos-contrib/radix/v3/resp"
13+
"github.com/neffos-contrib/radix/v3/resp/resp2"
14+
"github.com/neffos-contrib/radix/v3/trace"
1515
)
1616

1717
// dedupe is used to deduplicate a function invocation, so if multiple

cluster_stub_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010

1111
errors "golang.org/x/xerrors"
1212

13-
"github.com/mediocregopher/radix/v3/resp/resp2"
13+
"github.com/neffos-contrib/radix/v3/resp/resp2"
1414
"github.com/stretchr/testify/assert"
1515
"github.com/stretchr/testify/require"
1616
)

cluster_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"github.com/stretchr/testify/assert"
88
"github.com/stretchr/testify/require"
99

10-
"github.com/mediocregopher/radix/v3/trace"
10+
"github.com/neffos-contrib/radix/v3/trace"
1111
)
1212

1313
// clusterSlotKeys contains a random key for every slot. Unfortunately I haven't

cluster_topo.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import (
88

99
errors "golang.org/x/xerrors"
1010

11-
"github.com/mediocregopher/radix/v3/resp"
12-
"github.com/mediocregopher/radix/v3/resp/resp2"
11+
"github.com/neffos-contrib/radix/v3/resp"
12+
"github.com/neffos-contrib/radix/v3/resp/resp2"
1313
)
1414

1515
// ClusterNode describes a single node in the cluster at a moment in time.

cluster_topo_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import (
55
"bytes"
66
. "testing"
77

8-
"github.com/mediocregopher/radix/v3/resp"
9-
"github.com/mediocregopher/radix/v3/resp/resp2"
8+
"github.com/neffos-contrib/radix/v3/resp"
9+
"github.com/neffos-contrib/radix/v3/resp/resp2"
1010
"github.com/stretchr/testify/assert"
1111
"github.com/stretchr/testify/require"
1212
)

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module github.com/mediocregopher/radix/v3
1+
module github.com/neffos-contrib/radix/v3
22

33
require (
44
github.com/davecgh/go-spew v1.1.1 // indirect

internal/bytesutil/bytesutil.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
"strconv"
1010
"sync"
1111

12-
"github.com/mediocregopher/radix/v3/resp"
12+
"github.com/neffos-contrib/radix/v3/resp"
1313
errors "golang.org/x/xerrors"
1414
)
1515

pool.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import (
99

1010
errors "golang.org/x/xerrors"
1111

12-
"github.com/mediocregopher/radix/v3/resp"
13-
"github.com/mediocregopher/radix/v3/trace"
12+
"github.com/neffos-contrib/radix/v3/resp"
13+
"github.com/neffos-contrib/radix/v3/trace"
1414
)
1515

1616
// ErrPoolEmpty is used by Pools created using the PoolOnEmptyErrAfter option

pool_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ import (
1111
"github.com/stretchr/testify/require"
1212
errors "golang.org/x/xerrors"
1313

14-
"github.com/mediocregopher/radix/v3/resp"
15-
"github.com/mediocregopher/radix/v3/resp/resp2"
16-
"github.com/mediocregopher/radix/v3/trace"
14+
"github.com/neffos-contrib/radix/v3/resp"
15+
"github.com/neffos-contrib/radix/v3/resp/resp2"
16+
"github.com/neffos-contrib/radix/v3/trace"
1717
)
1818

1919
func testPool(size int, opts ...PoolOpt) *Pool {

pubsub.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import (
1010

1111
errors "golang.org/x/xerrors"
1212

13-
"github.com/mediocregopher/radix/v3/resp"
14-
"github.com/mediocregopher/radix/v3/resp/resp2"
13+
"github.com/neffos-contrib/radix/v3/resp"
14+
"github.com/neffos-contrib/radix/v3/resp/resp2"
1515
)
1616

1717
// PubSubMessage describes a message being published to a subscribed channel

pubsub_persistent.go

+6
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,12 @@ func (p *persistentPubSub) refresh() error {
133133
go func() {
134134
select {
135135
case <-errCh:
136+
// temp fix: https://github.com/neffos-contrib/radix/issues/184
137+
select {
138+
case <-p.closeCh:
139+
return
140+
default:
141+
}
136142
p.l.Lock()
137143
// It's possible that one of the methods (e.g. Subscribe)
138144
// already had the lock, saw the error, and called refresh. This

pubsub_stub.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import (
88

99
errors "golang.org/x/xerrors"
1010

11-
"github.com/mediocregopher/radix/v3/resp"
12-
"github.com/mediocregopher/radix/v3/resp/resp2"
11+
"github.com/neffos-contrib/radix/v3/resp"
12+
"github.com/neffos-contrib/radix/v3/resp/resp2"
1313
)
1414

1515
var errPubSubMode = resp2.Error{

pubsub_stub_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
. "testing"
66
"time"
77

8-
"github.com/mediocregopher/radix/v3/resp/resp2"
8+
"github.com/neffos-contrib/radix/v3/resp/resp2"
99
"github.com/stretchr/testify/assert"
1010
"github.com/stretchr/testify/require"
1111
)

radix.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ import (
173173

174174
errors "golang.org/x/xerrors"
175175

176-
"github.com/mediocregopher/radix/v3/resp"
176+
"github.com/neffos-contrib/radix/v3/resp"
177177
)
178178

179179
var errClientClosed = errors.New("client is closed")

resp/resp2/resp.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ import (
1818

1919
errors "golang.org/x/xerrors"
2020

21-
"github.com/mediocregopher/radix/v3/internal/bytesutil"
22-
"github.com/mediocregopher/radix/v3/resp"
21+
"github.com/neffos-contrib/radix/v3/internal/bytesutil"
22+
"github.com/neffos-contrib/radix/v3/resp"
2323
)
2424

2525
var delim = []byte{'\r', '\n'}

resp/resp2/resp_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99

1010
errors "golang.org/x/xerrors"
1111

12-
"github.com/mediocregopher/radix/v3/resp"
12+
"github.com/neffos-contrib/radix/v3/resp"
1313
"github.com/stretchr/testify/assert"
1414
"github.com/stretchr/testify/require"
1515
)

scanner.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77

88
errors "golang.org/x/xerrors"
99

10-
"github.com/mediocregopher/radix/v3/resp/resp2"
10+
"github.com/neffos-contrib/radix/v3/resp/resp2"
1111
)
1212

1313
// Scanner is used to iterate through the results of a SCAN call (or HSCAN,

stream.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ import (
1111

1212
errors "golang.org/x/xerrors"
1313

14-
"github.com/mediocregopher/radix/v3/internal/bytesutil"
15-
"github.com/mediocregopher/radix/v3/resp"
16-
"github.com/mediocregopher/radix/v3/resp/resp2"
14+
"github.com/neffos-contrib/radix/v3/internal/bytesutil"
15+
"github.com/neffos-contrib/radix/v3/resp"
16+
"github.com/neffos-contrib/radix/v3/resp/resp2"
1717
)
1818

1919
// StreamEntryID represents an ID used in a Redis stream with the format <time>-<seq>.

stub.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import (
99

1010
errors "golang.org/x/xerrors"
1111

12-
"github.com/mediocregopher/radix/v3/resp"
13-
"github.com/mediocregopher/radix/v3/resp/resp2"
12+
"github.com/neffos-contrib/radix/v3/resp"
13+
"github.com/neffos-contrib/radix/v3/resp/resp2"
1414
)
1515

1616
type bufferAddr struct {

stub_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010

1111
errors "golang.org/x/xerrors"
1212

13-
"github.com/mediocregopher/radix/v3/resp/resp2"
13+
"github.com/neffos-contrib/radix/v3/resp/resp2"
1414
"github.com/stretchr/testify/assert"
1515
"github.com/stretchr/testify/require"
1616
)

0 commit comments

Comments
 (0)