shmemory

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: May 4, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

View Source
var ErrBusNotStarted = errors.New("streams: 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 Reader

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

Reader is the streams.Reader in-memory implementation

func NewReader

func NewReader(b *Bus) *Reader

NewReader allocates a new Reader ready to interact with the given Bus

func (*Reader) ExecuteTask

func (l *Reader) ExecuteTask(ctx context.Context, t streams.ReaderTask) error

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

type Writer

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

Writer is the streams.Writer in-memory implementation

func NewWriter

func NewWriter(b *Bus) *Writer

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

func (*Writer) Write

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

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

func (*Writer) WriteBatch

func (p *Writer) WriteBatch(ctx context.Context, messages ...streams.Message) (published uint32, 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