script

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 1 more Imports: 2 Imported by: 0

Documentation

Overview

Package script optimizes lua script execution.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Script

type Script struct {
	*redis.Script
}

Script is script optimization class.

func New

func New(src string) *Script

New creates a new redis script optimizer object.

func (*Script) RunEx

func (s *Script) RunEx(ctx context.Context, c redis.Scripter, keys []string, args ...interface{}) *redis.Cmd

RunEx executes the lua script. If the script does not exist on the server, it will be executed and uploaded through Eval, and if it exists, it will be executed through EvalSha However: in pipeline mode, if redis.Script.Run executes EvalSha and reports that the script does not exist, it will not be able to call Eval to retry, so optimization is prohibited in pipeline mode.

Jump to

Keyboard shortcuts

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