task

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Channel

type Channel[V any] interface {
	Name() string
	ValueFormat() format.Format[V]
}

func GenericChannel

func GenericChannel[V any](channel string, valueFormat format.Format[V]) Channel[V]

func JsonChannel

func JsonChannel[V any](channel string) Channel[V]

func ProtobufChannel

func ProtobufChannel[V proto.Message](channel string) Channel[V]

func StringChannel

func StringChannel(channel string) Channel[string]

type Executor

type Executor[T any] func(context.Context, Message[T]) error

type Message

type Message[V any] struct {
	Channel   string
	Value     V
	Headers   map[string]any
	Timestamp time.Time
}

func Convert

func Convert[V1 any, V2 any](
	source Message[V1],
	v1 format.Format[V1],
	v2 format.Format[V2],
) (Message[V2], error)

assuming byte compatibility, i.e. bytes <-> proto, string <-> json

type Producer

type Producer interface {
	Produce(context.Context, Message[structure.Bytes]) error
	Start() error
	Stop()
}

type Scheduler

type Scheduler[T any] func(context.Context) (Message[T], error)

Jump to

Keyboard shortcuts

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