Documentation
¶
Index ¶
- Variables
- func Observe[T any](ctx context.Context, o Observer[T]) iter.Seq[T]
- func Subscribe[T any](ctx context.Context, source Observable[T], subscriber Subscriber[T])
- func Values[T any](ctx context.Context, o ValueObservable[T]) iter.Seq[T]
- type Cancelable
- type NotifiableObserver
- type Observable
- type ObservableFunc
- type Observer
- type Subject
- type Subscriber
- type ValueNotifier
- type ValueObservable
Constants ¶
This section is empty.
Variables ¶
View Source
var Completed = errors.New("completed")
Functions ¶
func Subscribe ¶
func Subscribe[T any](ctx context.Context, source Observable[T], subscriber Subscriber[T])
Types ¶
type Cancelable ¶
type Cancelable interface {
CancelCause(err error)
}
type NotifiableObserver ¶
type NotifiableObserver[T any] interface { ValueNotifier[T] ValueObservable[T] Cancelable Done() <-chan struct{} Err() error }
func NewNotifiableObserver ¶
func NewNotifiableObserver[T any]() NotifiableObserver[T]
type Observable ¶
type ObservableFunc ¶
func (ObservableFunc[T]) Observe ¶
func (fn ObservableFunc[T]) Observe() Observer[T]
type Observer ¶
type Observer[T any] interface { ValueObservable[T] Cancelable Done() <-chan struct{} Err() error }
type Subject ¶
type Subject[T any] struct { // contains filtered or unexported fields }
func (*Subject[T]) CancelCause ¶
func (*Subject[T]) Subscribe ¶
func (c *Subject[T]) Subscribe(o Subscriber[T])
type Subscriber ¶
type Subscriber[T any] interface { ValueNotifier[T] Cancelable Done() <-chan struct{} Err() error }
type ValueNotifier ¶
type ValueNotifier[T any] interface { Send(x T) }
type ValueObservable ¶
type ValueObservable[T any] interface { Value() <-chan T }
Click to show internal directories.
Click to hide internal directories.