xchan

package
v0.0.0-...-ab57856 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Completed = errors.New("completed")

Functions

func Observe

func Observe[T any](ctx context.Context, o Observer[T]) iter.Seq[T]

func Values

func Values[T any](ctx context.Context, o Observable[T]) iter.Seq[T]

Types

type Cancelable

type Cancelable interface {
	CancelCause(err error)
}

type Observable

type Observable[T any] interface {
	Value() <-chan T
}

type Observer

type Observer[T any] interface {
	Observable[T]
	Cancelable
	Done() <-chan struct{}
}

type Subject

type Subject[T any] struct {
	// contains filtered or unexported fields
}

func (*Subject[T]) CancelCause

func (s *Subject[T]) CancelCause(err error)

func (*Subject[T]) Observe

func (s *Subject[T]) Observe() Observer[T]

func (*Subject[T]) Send

func (s *Subject[T]) Send(value T)

type ValueNotifier

type ValueNotifier[T any] interface {
	Send(x T)
}

Jump to

Keyboard shortcuts

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