observable

package
v0.3.8 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2024 License: GPL-2.0 Imports: 2 Imported by: 13

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Observable

type Observable[T any] interface {
	Subscribe() (subscription Subscription[T], done <-chan struct{}, err error)
	UnSubscribe(subscription Subscription[T])
}

type Observer

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

func NewObserver

func NewObserver[T any](subscriber *Subscriber[T], listenerBufferSize int) *Observer[T]

func (*Observer[T]) Close

func (o *Observer[T]) Close() error

func (*Observer[T]) Emit

func (o *Observer[T]) Emit(item T)

func (*Observer[T]) Subscribe

func (o *Observer[T]) Subscribe() (subscription Subscription[T], done <-chan struct{}, err error)

func (*Observer[T]) UnSubscribe

func (o *Observer[T]) UnSubscribe(subscription Subscription[T])

type Subscriber

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

func NewSubscriber

func NewSubscriber[T any](size int) *Subscriber[T]

func (*Subscriber[T]) Close

func (s *Subscriber[T]) Close() error

func (*Subscriber[T]) Emit

func (s *Subscriber[T]) Emit(item T)

func (*Subscriber[T]) Subscription

func (s *Subscriber[T]) Subscription() (subscription Subscription[T], done <-chan struct{})

type Subscription

type Subscription[T any] <-chan T

Jump to

Keyboard shortcuts

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