saga

package
v0.8.7 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Mandatabale

func Mandatabale[T, ST any](e *Event[ST], f func(t T)) func(T) Executable

func Worker

func Worker(c chan Executable)

Types

type Event

type Event[RT any] struct {
	Func SagaExecuteFunc[RT]
	// contains filtered or unexported fields
}

func (*Event[RT]) Distribute

func (e *Event[RT]) Distribute(r RT) (n []Executable)

func (*Event[RT]) Execute

func (e *Event[RT]) Execute() (n []Executable, err error)

func (*Event[RT]) Mandates

func (e *Event[RT]) Mandates(r Requireing[RT])

type Executable

type Executable interface {
	Execute() ([]Executable, error)
}

type Requireing

type Requireing[T any] func(T) Executable

func End

func End[T any](s *Saga) Requireing[T]

type Saga

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

func (*Saga) End

func (s *Saga) End(any) Executable

func (*Saga) Event

func (s *Saga) Event(e Executable)

func (*Saga) Execute

func (s *Saga) Execute(c chan<- Executable)

type SagaExecuteFunc

type SagaExecuteFunc[RT any] func() (RT, error)

Jump to

Keyboard shortcuts

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