streamhub_memory

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package streamhub-memory is the In-Memory implementation for Streamhub-based programs.

Index

Constants

This section is empty.

Variables

View Source
var ErrBusNotStarted = errors.New("streamhub: In-memory bus has not been started")

ErrBusNotStarted The in-memory bus has not been started

Functions

This section is empty.

Types

type Bus

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

Bus is an in-memory message broker to enable interactions between publishers and stream-listeners

func NewBus

func NewBus(maxGoroutines int) *Bus

NewBus allocates a new Bus ready to be used

type ListenerDriver

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

ListenerDriver is the streamhub.ListenerDriver in-memory implementation

func NewListener

func NewListener(b *Bus) *ListenerDriver

NewListener allocates a new ListenerDriver ready to interact with the given Bus

func (*ListenerDriver) ExecuteTask

func (l *ListenerDriver) ExecuteTask(ctx context.Context, t streamhub.ListenerTask) error

ExecuteTask starts the stream-listening job using the internal in-memory Bus

type Writer added in v0.1.5

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

Writer is the streamhub.Writer in-memory implementation

func NewWriter added in v0.1.5

func NewWriter(b *Bus) *Writer

NewWriter allocates a new Writer ready to be used with the given Bus

func (*Writer) Write added in v0.1.5

func (p *Writer) Write(ctx context.Context, message streamhub.Message) error

Write pushes the given message into the internal in-memory Bus

func (*Writer) WriteBatch added in v0.1.5

func (p *Writer) WriteBatch(ctx context.Context, messages ...streamhub.Message) (err error)

WriteBatch pushes the given set of messages into the internal in-memory Bus

Jump to

Keyboard shortcuts

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