shunt

package
v0.1.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MsgHandler

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

MsgHandler : msg handler

func NewMsgHandler

func NewMsgHandler() *MsgHandler

func (*MsgHandler) GetFn

func (h *MsgHandler) GetFn(fnIndex int) ProcMsgFn

GetFn -- get function by fn index

func (*MsgHandler) GetFunctionName

func (h *MsgHandler) GetFunctionName(fnIndex int) string

GetFunctionName -- get function name by fn index

func (*MsgHandler) RegisterFn

func (h *MsgHandler) RegisterFn(name string, fnIndex int, fn ProcMsgFn)

RegisterFn -- register function

type MsgProc

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

func NewMsgProc

func NewMsgProc(ctx context.Context, slotIndex int, fnIndex int, inputMsg proto.Message) *MsgProc

func (*MsgProc) GetOutput

func (m *MsgProc) GetOutput() (proto.Message, error)

func (*MsgProc) SetOutput

func (m *MsgProc) SetOutput(outputMsg proto.Message, err error)

type OutPutMsg

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

type ProcMsgFn

type ProcMsgFn func(ctx context.Context, index int, inputMsg proto.Message) (outputMsg proto.Message, err error)

ProcMsgFn function

type ProcMsgInfo

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

ProcMsgInfo -- name and function

type Shunt

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

Shunt multi-queue: like shunt

func NewShunt

func NewShunt(opts ...pipe.Option) *Shunt

NewShunt : new shunt

func NewShuntWithSize

func NewShuntWithSize(slotSize int, qSizeInSlot int) *Shunt

NewShuntWithSize : new shunt with size

func (*Shunt) AddMsg

func (s *Shunt) AddMsg(ctx context.Context, slotIndex int, fnIndex int, inputMsg proto.Message) (*MsgProc, error)

AddMsg : add msg

func (*Shunt) AddPriorMsg

func (s *Shunt) AddPriorMsg(ctx context.Context, slotIndex int, fnIndex int, inputMsg proto.Message) (*MsgProc, error)

AddPriorMsg : add prior msg

func (*Shunt) RegisterMsgHandler

func (s *Shunt) RegisterMsgHandler(name string, fnIndex int, fn ProcMsgFn)

RegisterMsgHandler : register msg handler

func (*Shunt) Run

func (s *Shunt) Run()

Run : run all queue msg handler

func (*Shunt) SizeOfQInSlot

func (s *Shunt) SizeOfQInSlot() int

SizeOfQInSlot : get queue size in each slot

func (*Shunt) SizeOfSlot

func (s *Shunt) SizeOfSlot() int

SizeOfSlot : get slot size

func (*Shunt) Stop

func (s *Shunt) Stop()

Stop : stop

func (*Shunt) WaitStop

func (s *Shunt) WaitStop(ctx context.Context) error

WaitStop : wait stop

Jump to

Keyboard shortcuts

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