stack

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

The package support the stack queue LIFO (or FILO) for using them in conveyor.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(length int) faces.IChan

Create a new stack

Types

type IStack

type IStack interface {
	Len() int32
	ChanIn() chan interface{}
	ChanOut() chan interface{}
}

type Stack

type Stack struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func Init

func Init(limit int, ctx context.Context) *Stack

func (*Stack) ChanIn

func (stack *Stack) ChanIn() faces.MainCh

func (*Stack) ChanOut

func (stack *Stack) ChanOut() faces.MainCh

func (*Stack) Close

func (stack *Stack) Close()

Close()

func (*Stack) Count

func (stack *Stack) Count() int

Returns the number of items in the stack

func (*Stack) Info

func (stack *Stack) Info() *nodes.ChanData

func (*Stack) IsActive

func (stack *Stack) IsActive() bool

IsActive

func (*Stack) Len

func (stack *Stack) Len() int

Returns the max available number items in the stack

func (*Stack) Push

func (stack *Stack) Push(item faces.IItem)

Jump to

Keyboard shortcuts

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