concurrent

package
v0.0.0-...-69312e8 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2018 License: MIT Imports: 5 Imported by: 0

README

THIS SUB PACKAGE IS DEPRECATED!!!

If this package is reopened, I will definitely rewrite it.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotPrep = errors.New("the next Value is not prepared yet")
View Source
var ErrVChanClosed = errors.New("the value-channel has been closed")

Functions

This section is empty.

Types

type Concurrent

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

Concurrent represents a concurrent operation unit

func New

func New(threads int, orderReturn bool) *Concurrent

New returns a new ConCurrent struct pointer

func (*Concurrent) AddError

func (c *Concurrent) AddError(e error)

func (*Concurrent) Call

func (c *Concurrent) Call(function interface{}, params ...interface{}) error

Call will execute the function concurrently, if the function is executable

func (*Concurrent) Clear

func (c *Concurrent) Clear()

Clear flush the return-value channel

func (*Concurrent) ClearErrors

func (c *Concurrent) ClearErrors()

func (*Concurrent) Close

func (c *Concurrent) Close()

Close closes the concurrent instance, it will block until all the process are finished

func (*Concurrent) GetErrors

func (c *Concurrent) GetErrors() []error

func (*Concurrent) GetLastError

func (c *Concurrent) GetLastError() error

func (*Concurrent) HasError

func (c *Concurrent) HasError() bool

func (*Concurrent) Next

func (c *Concurrent) Next() ([]interface{}, error)

Next will return the value performed by the function, and if it's not prepared yet, Next will block the process

func (*Concurrent) NextNoBlock

func (c *Concurrent) NextNoBlock() ([]interface{}, error)

NextNoBlock will the value performed by the function without blocking

func (*Concurrent) Wait

func (c *Concurrent) Wait()

Wait will block until all processes are completed

Jump to

Keyboard shortcuts

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