parallel

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2020 License: MIT Imports: 7 Imported by: 0

README

parallel

Parallel Processing Library

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Test_Assert

func Test_Assert(t *testing.T, condition bool, msg string, v ...interface{})

assert fails the test if the condition is false.

func Test_Equals

func Test_Equals(t *testing.T, exp, act interface{})

equals fails the test if exp is not equal to act.

func Test_Nil

func Test_Nil(t *testing.T, val interface{})

ok fails the test if an err is not nil.

func Test_NotNil

func Test_NotNil(t *testing.T, val interface{})

Types

type Parallel

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

func New

func New() *Parallel

func (*Parallel) CloseDataChannel

func (p *Parallel) CloseDataChannel(name string) error

func (*Parallel) NewDataChannel

func (p *Parallel) NewDataChannel(name string) error

func (*Parallel) NewWorker

func (p *Parallel) NewWorker(name string, cfg *WorkerConfig) (*Worker, error)

func (*Parallel) Worker

func (p *Parallel) Worker(name string) *Worker

type Test_Struct

type Test_Struct struct {
	Counter int
	Mutex   sync.Mutex
}

type Worker

type Worker struct {
	Name   string
	Config *WorkerConfig
	// contains filtered or unexported fields
}

func (*Worker) SetExecution

func (w *Worker) SetExecution(exec func(wh *WorkerHelper, args interface{}))

func (*Worker) SetParallelism

func (w *Worker) SetParallelism(p int)

func (*Worker) Start

func (w *Worker) Start(args interface{})

func (*Worker) Wait

func (w *Worker) Wait()

type WorkerConfig

type WorkerConfig struct {
	Parallelism int
}

type WorkerHelper

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

func (*WorkerHelper) ConsumeData

func (wh *WorkerHelper) ConsumeData(name string) (interface{}, error)

func (*WorkerHelper) ConsumeDataInBatches

func (wh *WorkerHelper) ConsumeDataInBatches(name string, size int) ([]interface{}, error)

func (*WorkerHelper) Done

func (wh *WorkerHelper) Done()

func (*WorkerHelper) PublishData

func (wh *WorkerHelper) PublishData(name string, data interface{}) error

Jump to

Keyboard shortcuts

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