processor

package
v0.0.0-...-a9ed6da Latest Latest
Warning

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

Go to latest
Published: May 7, 2018 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package processor defines the document processing unit interface

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EngineProcessor

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

func NewEngineProcessor

func NewEngineProcessor(ctx context.T, commandWorkerLimit int, cancelWorkerLimit int, supportedDocs []contracts.DocumentType) *EngineProcessor

TODO worker pool should be triggered in the Start() function supported document types indicate the domain of the documentes the Processor with run upon. There'll be race-conditions if there're multiple Processors in a certain domain.

func (*EngineProcessor) Cancel

func (p *EngineProcessor) Cancel(docState contracts.DocumentState)

func (*EngineProcessor) InitialProcessing

func (p *EngineProcessor) InitialProcessing() (err error)

func (*EngineProcessor) Start

func (p *EngineProcessor) Start() (resChan chan contracts.DocumentResult, err error)

func (*EngineProcessor) Stop

func (p *EngineProcessor) Stop(stopType contracts.StopType)

Stop set the cancel flags of all the running jobs, which are to be captured by the command worker and shutdown gracefully

func (*EngineProcessor) Submit

func (p *EngineProcessor) Submit(docState contracts.DocumentState)

Submit() is the public interface for sending run document request to processor

type ExecuterCreator

type ExecuterCreator func(ctx context.T) executer.Executer

type Processor

type Processor interface {
	//Start activate the Processor and pick up the left over document in the last run, it returns a channel to caller to gather DocumentResult
	Start() (chan contracts.DocumentResult, error)
	//Process any initial documents loaded from file directory. This should be run after Start().
	InitialProcessing() error
	//Stop the processor, save the current state to resume later
	Stop(stopType contracts.StopType)
	//submit to the pool a document in form of docState object, results will be streamed back from the central channel returned by Start()
	Submit(docState contracts.DocumentState)
	//cancel process the cancel document, with no return value since the command is already tracked in a different thread
	Cancel(docState contracts.DocumentState)
}

Directories

Path Synopsis
Package executer provides interfaces as document execution logic
Package executer provides interfaces as document execution logic
basicexecuter
Package basicexecuter provides interfaces as document execution logic
Package basicexecuter provides interfaces as document execution logic
iohandler
Package iohandler implements the iohandler for the plugins
Package iohandler implements the iohandler for the plugins
iohandler/iomodule
Package iomodule implements the output modules
Package iomodule implements the output modules
iohandler/iomodule/mock
Package iomodulemock implements the mock iomodule
Package iomodulemock implements the mock iomodule
iohandler/mock
Package iohandlermocks implements the mock iohandler
Package iohandlermocks implements the mock iohandler
iohandler/multiwriter
Package multiwriter implements a multi-writer
Package multiwriter implements a multi-writer
iohandler/multiwriter/mock
Package multiwritermock creates the mock mulitwriter
Package multiwritermock creates the mock mulitwriter
mock
Package executer provides interfaces as document execution logic
Package executer provides interfaces as document execution logic
outofproc/proc
Package process wraps up the os.Process interface and also provides os-specific process lookup functions
Package process wraps up the os.Process interface and also provides os-specific process lookup functions
plugin
Package plugin contains general interfaces and types relevant to plugins.
Package plugin contains general interfaces and types relevant to plugins.

Jump to

Keyboard shortcuts

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