minibus

package
v0.0.0-...-8846729 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package minibus implements a minimalist many-to-many event bus.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DropExcess

func DropExcess(in <-chan any) <-chan any

DropExcess will wrap a channel to break backpressure between its input and output. It will drop incoming messages when the consumer can't process them fast enough. When the consumer receives, it will always get the most recent message sent by the producer.

Types

type Bus

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

func (*Bus) Listen

func (b *Bus) Listen(ctx context.Context) <-chan any

func (*Bus) Send

func (b *Bus) Send(ctx context.Context, event any) (ok bool)

Jump to

Keyboard shortcuts

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