cycle

package
v0.1.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cycle

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

Cycle : multi-queue cycle

func NewCycle

func NewCycle(qHandler QHandler, opts ...pipe.Option) *Cycle

NewCycle : new cycle

func NewRunCycle

func NewRunCycle(qHandler QHandler, opts ...pipe.Option) *Cycle

NewRunCycle : new cycle and run

func (*Cycle) Call

func (c *Cycle) Call(ctx context.Context, slotIndex int, req interface{}) (interface{}, error)

Call : wrap call

func (*Cycle) CallPrior

func (c *Cycle) CallPrior(ctx context.Context, slotIndex int, req interface{}) (interface{}, error)

CallPrior : wrap prior call

func (*Cycle) NormalizeSlotIndex

func (c *Cycle) NormalizeSlotIndex(index int) int

NormalizeSlotIndex slot index

func (*Cycle) Run

func (c *Cycle) Run()

Run : run all queue msg handler

func (*Cycle) SizeOfQInSlot

func (c *Cycle) SizeOfQInSlot() int

SizeOfQInSlot : get queue size in each slot

func (*Cycle) SizeOfSlot

func (c *Cycle) SizeOfSlot() int

SizeOfSlot : get slot size

func (*Cycle) Stop

func (c *Cycle) Stop()

Stop : stop

func (*Cycle) WaitStop

func (c *Cycle) WaitStop(ctx context.Context) error

WaitStop : wait stop

type GenProc

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

GenProc : generic proc

func NewGenProc

func NewGenProc(ctx context.Context, slotIndex int, req interface{}) *GenProc

func (*GenProc) Rsp

func (m *GenProc) Rsp() (interface{}, error)

func (*GenProc) SetRsp

func (m *GenProc) SetRsp(rsp interface{}, err error)

type QHandler

type QHandler func(ctx context.Context, index int, req interface{}) (interface{}, error)

QHandler : queue handler

type Rsp

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

Jump to

Keyboard shortcuts

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