From 4f66c5f32b78b46e9801842c216e5220488b0a5a Mon Sep 17 00:00:00 2001 From: Andrey Kuzmin Date: Fri, 12 Apr 2019 15:08:00 +0300 Subject: [PATCH] Move comment to Pipeliner interface. To remove all text copies. --- cluster.go | 13 ------------- pipeline.go | 26 +++++++++++++------------- redis.go | 26 -------------------------- ring.go | 13 ------------- 4 files changed, 13 insertions(+), 65 deletions(-) diff --git a/cluster.go b/cluster.go index 34c57746..c9f1384b 100644 --- a/cluster.go +++ b/cluster.go @@ -1182,19 +1182,6 @@ func (c *ClusterClient) reaper(idleCheckFrequency time.Duration) { } } -// Pipeline returns mechanism to realise Redis Pipeline technique. -// -// Pipelining is a technique to extremely speed up processing by packing -// operations to batches, send them at once to Redis and read a replies in a -// singe step. -// See https://redis.io/topics/pipelining -// -// Pay attention, that Pipeline is not a transaction, so you can get unexpected -// results in case of big pipelines and small read/write timeouts. -// Redis client has retransmission logic in case of timeouts, pipeline -// can be retransmitted and commands can be executed more then once. -// To avoid this: it is good idea to use reasonable bigger read/write timeouts -// depends of your batch size and/or use TxPipeline. func (c *ClusterClient) Pipeline() Pipeliner { pipe := Pipeline{ exec: c.processPipeline, diff --git a/pipeline.go b/pipeline.go index 1afa2e5e..2714ceb8 100644 --- a/pipeline.go +++ b/pipeline.go @@ -8,6 +8,19 @@ import ( type pipelineExecer func([]Cmder) error +// Pipeliner is an mechanism to realise Redis Pipeline technique. +// +// Pipelining is a technique to extremely speed up processing by packing +// operations to batches, send them at once to Redis and read a replies in a +// singe step. +// See https://redis.io/topics/pipelining +// +// Pay attention, that Pipeline is not a transaction, so you can get unexpected +// results in case of big pipelines and small read/write timeouts. +// Redis client has retransmission logic in case of timeouts, pipeline +// can be retransmitted and commands can be executed more then once. +// To avoid this: it is good idea to use reasonable bigger read/write timeouts +// depends of your batch size and/or use TxPipeline. type Pipeliner interface { StatefulCmdable Do(args ...interface{}) *Cmd @@ -107,19 +120,6 @@ func (c *Pipeline) Pipelined(fn func(Pipeliner) error) ([]Cmder, error) { return c.pipelined(fn) } -// Pipeline returns mechanism to realise Redis Pipeline technique. -// -// Pipelining is a technique to extremely speed up processing by packing -// operations to batches, send them at once to Redis and read a replies in a -// singe step. -// See https://redis.io/topics/pipelining -// -// Pay attention, that Pipeline is not a transaction, so you can get unexpected -// results in case of big pipelines and small read/write timeouts. -// Redis client has retransmission logic in case of timeouts, pipeline -// can be retransmitted and commands can be executed more then once. -// To avoid this: it is good idea to use reasonable bigger read/write timeouts -// depends of your batch size and/or use TxPipeline. func (c *Pipeline) Pipeline() Pipeliner { return c } diff --git a/redis.go b/redis.go index 842f4dec..644c8da8 100644 --- a/redis.go +++ b/redis.go @@ -456,19 +456,6 @@ func (c *Client) Pipelined(fn func(Pipeliner) error) ([]Cmder, error) { return c.Pipeline().Pipelined(fn) } -// Pipeline returns mechanism to realise Redis Pipeline technique. -// -// Pipelining is a technique to extremely speed up processing by packing -// operations to batches, send them at once to Redis and read a replies in a -// singe step. -// See https://redis.io/topics/pipelining -// -// Pay attention, that Pipeline is not a transaction, so you can get unexpected -// results in case of big pipelines and small read/write timeouts. -// Redis client has retransmission logic in case of timeouts, pipeline -// can be retransmitted and commands can be executed more then once. -// To avoid this: it is good idea to use reasonable bigger read/write timeouts -// depends of your batch size and/or use TxPipeline. func (c *Client) Pipeline() Pipeliner { pipe := Pipeline{ exec: c.processPipeline, @@ -571,19 +558,6 @@ func (c *Conn) Pipelined(fn func(Pipeliner) error) ([]Cmder, error) { return c.Pipeline().Pipelined(fn) } -// Pipeline returns mechanism to realise Redis Pipeline technique. -// -// Pipelining is a technique to extremely speed up processing by packing -// operations to batches, send them at once to Redis and read a replies in a -// singe step. -// See https://redis.io/topics/pipelining -// -// Pay attention, that Pipeline is not a transaction, so you can get unexpected -// results in case of big pipelines and small read/write timeouts. -// Redis client has retransmission logic in case of timeouts, pipeline -// can be retransmitted and commands can be executed more then once. -// To avoid this: it is good idea to use reasonable bigger read/write timeouts -// depends of your batch size and/or use TxPipeline. func (c *Conn) Pipeline() Pipeliner { pipe := Pipeline{ exec: c.processPipeline, diff --git a/ring.go b/ring.go index eb6b4b3b..aa475432 100644 --- a/ring.go +++ b/ring.go @@ -558,19 +558,6 @@ func (c *Ring) defaultProcess(cmd Cmder) error { return cmd.Err() } -// Pipeline returns mechanism to realise Redis Pipeline technique. -// -// Pipelining is a technique to extremely speed up processing by packing -// operations to batches, send them at once to Redis and read a replies in a -// singe step. -// See https://redis.io/topics/pipelining -// -// Pay attention, that Pipeline is not a transaction, so you can get unexpected -// results in case of big pipelines and small read/write timeouts. -// Redis client has retransmission logic in case of timeouts, pipeline -// can be retransmitted and commands can be executed more then once. -// To avoid this: it is good idea to use reasonable bigger read/write timeouts -// depends of your batch size and/or use TxPipeline. func (c *Ring) Pipeline() Pipeliner { pipe := Pipeline{ exec: c.processPipeline,