async

package module
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const Unlimit = 0

Variables

This section is empty.

Functions

func All

func All(methods []LambdaMethod, timeout time.Duration) []interface{}

func Any

func Any(methods []LambdaMethod, timeout time.Duration) ([]interface{}, error)

func AnyOne

func AnyOne(methods []LambdaMethod, timeout time.Duration) (interface{}, []error)

func Call

func Call(m Method, timeout time.Duration, args ...interface{}) (interface{}, error)

func Flow

func Flow(enter Method, args []interface{}, methods []Method, timeout time.Duration) (interface{}, error)

func Foreach added in v0.1.2

func Foreach(objs []interface{}, method func(int) (interface{}, error), maxCount int) []interface{}

func Lambda

func Lambda(method func() (interface{}, error), timeout time.Duration) (interface{}, error)

func Parallel added in v0.0.2

func Parallel(methods []LambdaMethod, maxCount int) []interface{}

func Retry added in v0.0.9

func Retry(method func() (interface{}, error), maxCount int, interval time.Duration) (interface{}, error)

func Safety added in v0.0.5

func Safety(method func() (interface{}, error)) (res interface{}, err error)

func Serise

func Serise(methods []LambdaMethod, timeout time.Duration) []interface{}

func SetPanicHandler added in v0.0.2

func SetPanicHandler(hanlder func(interface{}))

Types

type Batch added in v0.0.9

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

func NewBatch added in v0.0.9

func NewBatch(
	kernal func([]interface{}) (map[interface{}]interface{}, error),
	branchSize int,
	interval time.Duration) *Batch

func (*Batch) MGet added in v0.0.9

func (p *Batch) MGet(keys []interface{}) (map[interface{}]interface{}, error)

type GQuery

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

type KVCache

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

func NewKVCache

func NewKVCache() *KVCache

func (*KVCache) Commit

func (kv *KVCache) Commit(method func(*KVData) (interface{}, error)) (interface{}, error)

func (*KVCache) Destory

func (kv *KVCache) Destory()

func (*KVCache) LRU added in v0.1.5

func (kv *KVCache) LRU(flag bool) *KVCache

func (*KVCache) MaxSize

func (kv *KVCache) MaxSize(maxSize int) *KVCache

func (*KVCache) TTL

func (kv *KVCache) TTL(ttl int64) *KVCache

type KVData

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

func (*KVData) Clean added in v0.0.2

func (kv *KVData) Clean()

func (*KVData) Del

func (kv *KVData) Del(key interface{})

func (*KVData) Get

func (kv *KVData) Get(key interface{}) (interface{}, error)

func (*KVData) Keys

func (kv *KVData) Keys() []interface{}

func (*KVData) MDel

func (kv *KVData) MDel(keys []interface{})

func (*KVData) MGet

func (kv *KVData) MGet(keys []interface{}) []interface{}

func (*KVData) MSet

func (kv *KVData) MSet(keys []interface{}, values []interface{})

func (*KVData) Merge

func (kv *KVData) Merge(pairs map[interface{}]interface{})

func (*KVData) Set

func (kv *KVData) Set(key interface{}, value interface{})

type LambdaMethod

type LambdaMethod func() (interface{}, error)

type Merge

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

func NewMerge

func NewMerge() *Merge

func (*Merge) Destory added in v0.0.8

func (m *Merge) Destory()

func (*Merge) Exec added in v0.0.8

func (m *Merge) Exec(key string, method func() (interface{}, error)) (interface{}, error)

type Method

type Method func(args ...interface{}) (interface{}, error)

type QResult

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

type Query

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

Jump to

Keyboard shortcuts

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