utils

package
v0.0.0-...-41c7550 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: LGPL-3.0 Imports: 3 Imported by: 14

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Composer

type Composer interface {
	Spawn(int) Composer
	OnMessage(*Message, Done)
	Workers() int
}

Composer represents a component in the pipeline that performs a work on a message

type Done

type Done func(*Message, int, string)

Done should be called by a component in order to return the message to the message handler. Can be used by the last component to inform that the message processing is done o by a middle component to inform an error.

type Message

type Message struct {
	Opts    cmap.ConcurrentMap
	Reports *lane.Stack
	// contains filtered or unexported fields
}

Message is used to send data through the pipeline

func NewMessage

func NewMessage() *Message

NewMessage creates a new instance of Message

func (*Message) PopPayload

func (m *Message) PopPayload() (data []byte, err error)

PopPayload get the data stored by the previous handler

func (*Message) PushPayload

func (m *Message) PushPayload(data []byte)

PushPayload store data on an LIFO queue so the nexts handlers can use it

type Next

type Next func()

Next should be called by a component in order to pass the message to the next component in the pipeline.

Jump to

Keyboard shortcuts

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