component

package
v0.0.0-...-7232936 Latest Latest
Warning

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

Go to latest
Published: May 25, 2017 License: Apache-2.0 Imports: 0 Imported by: 3

Documentation

Index

Constants

View Source
const (
	// Done is the status code for indicating that the message has been
	// successfuly handled and should be sent to the next component
	Done = 0

	// Continue is the status code for indicating that the message has been
	// successfuly handled, but should not be sent to the next component
	Continue = 1

	// Retry is the status code for indicating that the worker has failed to
	// handle the message and should be retried again.
	Retry = 100

	// Fail is the status code for indicating that the worker has failed to
	// handle the message and should not be retried again.
	Fail = 200

	// Drop is the status code for indicating that the message has been discarded
	// by the worker and also shuold be
	Drop = 300
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Component

type Component interface {
	Handle(Message) *Report
}

Component represents any element in the pipeline that performs some work on a message.

A component should return a *Report containing the status of the action performed.

type Factory

type Factory interface {
	Create(postponed chan Message) Component
	Destroy()
	SetAttribute(key string, value interface{}) error
	PoolSize() int
	ChannelSize() int
}

Factory is used to create instances of Components

type Message

type Message interface {
	GetData() interface{}
	SetData(interface{})
	GetAttribute(string) interface{}
	SetAttribute(string, interface{})
	Status() *Report
	Release()
}

Message wraps the data sent through the pipeline

type Report

type Report struct {
	Status      int
	Description string
}

Report contains information about the result of processing a message

Jump to

Keyboard shortcuts

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