inmemory

package
v0.0.0-...-ee0c78d Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2021 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandBus

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

CommandBus is an in-memory implementation of the command.Bus.

func NewCommandBus

func NewCommandBus() *CommandBus

NewCommandBus initializes a new instance of CommandBus.

func (*CommandBus) Dispatch

func (b *CommandBus) Dispatch(ctx context.Context, cmd command.Command) error

Dispatch implements the command.Bus interface.

func (*CommandBus) Register

func (b *CommandBus) Register(cmdType command.Type, handler command.Handler)

Register implements the command.Bus interface.

type EventBus

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

EventBus is an in-memory implementation of the event.Bus.

func NewEventBus

func NewEventBus() *EventBus

NewEventBus initializes a new EventBus.

func (*EventBus) Publish

func (b *EventBus) Publish(ctx context.Context, events []event.Event) error

Publish implements the event.Bus interface.

func (*EventBus) Subscribe

func (b *EventBus) Subscribe(evtType event.Type, handler event.Handler)

Subscribe implements the event.Bus interface.

Jump to

Keyboard shortcuts

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