cuba

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2019 License: MIT Imports: 3 Imported by: 12

README

Project Cuba

Experiment in allowing workers to own the means of production.

Go's built in chans are based on the Communicating Sequential Processes (CSP) model. They work well when the processing is sequential, i.e.

Producer -> Processor [-> Processor ...] -> Consumer

But not everything fits well with this model, like when work is discovered as part of the processing. Examples are walking a directory structure, and finding more subdirectories as you go -- or a web crawler following hyperlinks from the pages it crawls.

Cuba attempts to build a parallel system where processes can both consume and produce work simultaneously.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CubaFunc

type CubaFunc func(interface{}) []interface{}

type CubaStack

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

func NewStack

func NewStack(worker CubaFunc) *CubaStack

func (*CubaStack) Close

func (ws *CubaStack) Close()

func (*CubaStack) Next

func (ws *CubaStack) Next() (interface{}, bool)

func (*CubaStack) Push

func (ws *CubaStack) Push(items []interface{})

func (*CubaStack) Run

func (ws *CubaStack) Run()

Directories

Path Synopsis
examples
dirwalk command
simple command

Jump to

Keyboard shortcuts

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