diff --git a/Gopkg.lock b/Gopkg.lock index d786251a3..2cfe13d56 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -65,11 +65,11 @@ revision = "0c63f026bcd6" [[projects]] - digest = "1:22ffd73c4580854d935821a0fa95ff7324df836efa86d256adeb392450cbde87" + digest = "1:f4f17bf49baf6cf0c3ba00ee2893a4c673b81fd227524956bc7c9fd64f58b133" name = "github.com/nsqio/go-diskqueue" packages = ["."] pruneopts = "" - revision = "74cfbc9de839" + revision = "8c228d7a2450265de03e1d42e21f59e23d6339c6" [[projects]] digest = "1:7a69f6a3a33929f8b66aa39c93868ad1698f06417fe627ae067559beb94504bd" diff --git a/Gopkg.toml b/Gopkg.toml index bb0bf6390..fa7048d72 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -59,7 +59,7 @@ [[constraint]] name = "github.com/nsqio/go-diskqueue" - revision = "74cfbc9de839" + revision = "8c228d7a2450265de03e1d42e21f59e23d6339c6" [[constraint]] name = "github.com/nsqio/go-nsq" diff --git a/go.mod b/go.mod index f4b7c15c5..618f0235e 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/judwhite/go-svc v1.0.0 github.com/julienschmidt/httprouter v1.2.0 github.com/mreiferson/go-options v0.0.0-20190302015348-0c63f026bcd6 - github.com/nsqio/go-diskqueue v0.0.0-20180306152900-74cfbc9de839 + github.com/nsqio/go-diskqueue v0.0.0-20191213054144-8c228d7a2450 github.com/nsqio/go-nsq v1.0.7 github.com/pmezard/go-difflib v1.0.0 // indirect github.com/stretchr/testify v1.2.2 // indirect diff --git a/go.sum b/go.sum index 63c62ab65..181b02b0d 100644 --- a/go.sum +++ b/go.sum @@ -18,8 +18,8 @@ github.com/julienschmidt/httprouter v1.2.0 h1:TDTW5Yz1mjftljbcKqRcrYhd4XeOoI98t+ github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/mreiferson/go-options v0.0.0-20190302015348-0c63f026bcd6 h1:frRvTmIp7QT1RPaphBvr6zvEHfvdOX7jMO7rvicCH9Q= github.com/mreiferson/go-options v0.0.0-20190302015348-0c63f026bcd6/go.mod h1:zHtCks/HQvOt8ATyfwVe3JJq2PPuImzXINPRTC03+9w= -github.com/nsqio/go-diskqueue v0.0.0-20180306152900-74cfbc9de839 h1:nZ0z0haJRzCXAWH9Jl+BUnfD2n2MCSbGRSl8VBX+zR0= -github.com/nsqio/go-diskqueue v0.0.0-20180306152900-74cfbc9de839/go.mod h1:AYinRDfdKMmVKTPI8wOcLgjcw2pTS3jo8fib1VxOzsE= +github.com/nsqio/go-diskqueue v0.0.0-20191213054144-8c228d7a2450 h1:5kOO/fS7AISHyIRPXdCbEefNxpc4bvYzRv6xmqPT4eQ= +github.com/nsqio/go-diskqueue v0.0.0-20191213054144-8c228d7a2450/go.mod h1:AYinRDfdKMmVKTPI8wOcLgjcw2pTS3jo8fib1VxOzsE= github.com/nsqio/go-nsq v1.0.7 h1:O0pIZJYTf+x7cZBA0UMY8WxFG79lYTURmWzAAh48ljY= github.com/nsqio/go-nsq v1.0.7/go.mod h1:XP5zaUs3pqf+Q71EqUJs3HYfBIqfK6G83WQMdNN+Ito= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= diff --git a/nsqd/backend_queue.go b/nsqd/backend_queue.go index 6679bb946..d6390ba13 100644 --- a/nsqd/backend_queue.go +++ b/nsqd/backend_queue.go @@ -4,7 +4,7 @@ package nsqd // storage system type BackendQueue interface { Put([]byte) error - ReadChan() chan []byte // this is expected to be an *unbuffered* channel + ReadChan() <-chan []byte // this is expected to be an *unbuffered* channel Close() error Delete() error Depth() int64 diff --git a/nsqd/dummy_backend_queue.go b/nsqd/dummy_backend_queue.go index 7b200ab98..386f6db52 100644 --- a/nsqd/dummy_backend_queue.go +++ b/nsqd/dummy_backend_queue.go @@ -12,7 +12,7 @@ func (d *dummyBackendQueue) Put([]byte) error { return nil } -func (d *dummyBackendQueue) ReadChan() chan []byte { +func (d *dummyBackendQueue) ReadChan() <-chan []byte { return d.readChan } diff --git a/nsqd/protocol_v2.go b/nsqd/protocol_v2.go index 31aeeacba..54cd526a9 100644 --- a/nsqd/protocol_v2.go +++ b/nsqd/protocol_v2.go @@ -202,7 +202,7 @@ func (p *protocolV2) Exec(client *clientV2, params [][]byte) ([]byte, error) { func (p *protocolV2) messagePump(client *clientV2, startedChan chan bool) { var err error var memoryMsgChan chan *Message - var backendMsgChan chan []byte + var backendMsgChan <-chan []byte var subChannel *Channel // NOTE: `flusherChan` is used to bound message latency for // the pathological case of a channel on a low volume topic diff --git a/nsqd/topic.go b/nsqd/topic.go index cd2b83065..3d7e95f61 100644 --- a/nsqd/topic.go +++ b/nsqd/topic.go @@ -247,7 +247,7 @@ func (t *Topic) messagePump() { var err error var chans []*Channel var memoryMsgChan chan *Message - var backendChan chan []byte + var backendChan <-chan []byte // do not pass messages before Start(), but avoid blocking Pause() or GetChannel() for { diff --git a/nsqd/topic_test.go b/nsqd/topic_test.go index 013b7ed08..0f0e1736f 100644 --- a/nsqd/topic_test.go +++ b/nsqd/topic_test.go @@ -54,12 +54,12 @@ func TestGetChannel(t *testing.T) { type errorBackendQueue struct{} -func (d *errorBackendQueue) Put([]byte) error { return errors.New("never gonna happen") } -func (d *errorBackendQueue) ReadChan() chan []byte { return nil } -func (d *errorBackendQueue) Close() error { return nil } -func (d *errorBackendQueue) Delete() error { return nil } -func (d *errorBackendQueue) Depth() int64 { return 0 } -func (d *errorBackendQueue) Empty() error { return nil } +func (d *errorBackendQueue) Put([]byte) error { return errors.New("never gonna happen") } +func (d *errorBackendQueue) ReadChan() <-chan []byte { return nil } +func (d *errorBackendQueue) Close() error { return nil } +func (d *errorBackendQueue) Delete() error { return nil } +func (d *errorBackendQueue) Depth() int64 { return 0 } +func (d *errorBackendQueue) Empty() error { return nil } type errorRecoveredBackendQueue struct{ errorBackendQueue }