redispipeline

package module
v4.0.0-...-11dc45a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 24, 2020 License: MIT Imports: 6 Imported by: 0

README

Go Report Card

redis-pipeline


this library is intended to replace redis worker pool by batching commands from multiple requests. All commands will be sent into single redis pipeline connection for single node redis where in the redis cluster environment, the batched commands will be pipelined into relevant nodes respectively. Every batch will be executed in particular interval (millisecond) or whenever the maxCommandsPerBatch is reached.

Examples are provided.

This library uses :

  1. redis-go-cluster removed on V3 - replaced by cluster package
  2. redi-go

Ccheck folder is command shell script to spawn redis cluster in your local machine. Please see README.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	// contains filtered or unexported fields
}

Command ...

type CommandResponse

type CommandResponse struct {
	CommandId int
	Value     interface{}
}

CommandResponse ...

type Node

type Node struct {
	// contains filtered or unexported fields
}

type RedisPipeline

type RedisPipeline interface {
	NewSession(ctx context.Context) RedisPipelineSession
	Close()
}

RedisPipeline interface

func NewRedisPipeline

func NewRedisPipeline(client redis.RedisClient, maxIntervalInMs uint64, maxCommandsPerBatch uint64) RedisPipeline

NewRedisPipeline initiate RedisPipeline interface

type RedisPipelineImpl

type RedisPipelineImpl struct {
	// contains filtered or unexported fields
}

RedisPipelineImpl Implementation of RedisPipeline interface

func (*RedisPipelineImpl) Close

func (rb *RedisPipelineImpl) Close()

func (*RedisPipelineImpl) NewSession

NewSession Of RedisPipeline

type RedisPipelineSession

type RedisPipelineSession interface {
	PushCommand(command string, args ...interface{}) RedisPipelineSession
	PushCommandReadOnly(command string, args ...interface{}) RedisPipelineSession
	Execute() ([]*CommandResponse, error)
}

RedisPipelineSession ...

type RedisPipelineSessionImpl

type RedisPipelineSessionImpl struct {
	// contains filtered or unexported fields
}

RedisPipelineSessionImpl ...

func (*RedisPipelineSessionImpl) Execute

func (ps *RedisPipelineSessionImpl) Execute() ([]*CommandResponse, error)

Execute all commands within session

func (*RedisPipelineSessionImpl) PushCommand

func (ps *RedisPipelineSessionImpl) PushCommand(command string, args ...interface{}) RedisPipelineSession

PushCommand push command to session

func (*RedisPipelineSessionImpl) PushCommandReadOnly

func (ps *RedisPipelineSessionImpl) PushCommandReadOnly(command string, args ...interface{}) RedisPipelineSession

type Session

type Session struct {
	// contains filtered or unexported fields
}

Session ...

type SessionResponse

type SessionResponse struct {
	CommandsResponses []*CommandResponse
	Err               error
}

SessionResponse ...

type Status

type Status struct {
	// contains filtered or unexported fields
}

Status ...

Directories

Path Synopsis
Command ccheck implements the consistency checker redis cluster client as described in http://redis.io/topics/cluster-tutorial.
Command ccheck implements the consistency checker redis cluster client as described in http://redis.io/topics/cluster-tutorial.
example

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL