rx

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2019 License: Apache-2.0 Imports: 3 Imported by: 15

Documentation

Index

Constants

View Source
const (
	// SignalComplete indicated that subscriber was completed.
	SignalComplete = SignalType(rs.SignalTypeComplete)
	// SignalCancel indicates that subscriber was cancelled.
	SignalCancel = SignalType(rs.SignalTypeCancel)
	// SignalError indicates that subscriber has some faults.
	SignalError = SignalType(rs.SignalTypeError)
)
View Source
const RequestMax = rs.RequestInfinite

Variables

View Source
var EmptyRawSubscriber rs.Subscriber

Functions

This section is empty.

Types

type Disposable

type Disposable interface {
	// Dispose dispose current resource.
	Dispose()
	// IsDisposed returns true if it has been disposed.
	IsDisposed() bool
}

Disposable is a disposable resource.

type FnFinally added in v0.3.0

type FnFinally = func(s SignalType)

FnFinally is alias of function for signal when all things done.

type FnOnCancel

type FnOnCancel = func()

FnOnCancel is alias of function for signal when subscription canceled.

type FnOnComplete

type FnOnComplete = func()

FnOnComplete is alias of function for signal when no more elements are available

type FnOnError

type FnOnError = func(e error)

FnOnError is alias of function for signal when an error occured.

type FnOnNext

type FnOnNext = func(input payload.Payload)

FnOnNext is alias of function for signal when next element arrived.

type FnOnRequest

type FnOnRequest = func(n int)

FnOnRequest is alias of function for signal when requesting next element.

type FnOnSubscribe

type FnOnSubscribe = func(s Subscription)

FnOnSubscribe is alias of function for signal when subscribe begin.

type FnPredicate added in v0.3.0

type FnPredicate = func(input payload.Payload) bool

FnPredicate is alias of function for filter operations.

type Publisher

type Publisher interface {
	RawPublisher
	// Subscribe subscribe elements from a publisher, returns a Disposable.
	// You can add some custome options.
	// Using `OnSubscribe`, `OnNext`, `OnComplete` and `OnError` as handler wrapper.
	Subscribe(ctx context.Context, options ...SubscriberOption)
}

Publisher is a provider of a potentially unbounded number of sequenced elements, \ publishing them according to the demand received from its Subscriber(s).

type RawPublisher added in v0.3.0

type RawPublisher interface {
	SubscribeWith(ctx context.Context, s Subscriber)
}

type SignalType

type SignalType rs.SignalType

SignalType is the signal of reactive events like `OnNext`, `OnComplete`, `OnCancel` and `OnError`.

func (SignalType) String added in v0.3.0

func (s SignalType) String() string

type Subscriber

type Subscriber interface {
	OnNext(payload payload.Payload)
	OnError(error)
	OnComplete()
	OnSubscribe(Subscription)
}
var EmptySubscriber Subscriber

func NewSubscriber added in v0.3.0

func NewSubscriber(opts ...SubscriberOption) Subscriber

type SubscriberOption added in v0.3.0

type SubscriberOption func(*subscriber)

func OnComplete

func OnComplete(onComplete FnOnComplete) SubscriberOption

func OnError

func OnError(onError FnOnError) SubscriberOption

func OnNext

func OnNext(onNext FnOnNext) SubscriberOption

func OnSubscribe

func OnSubscribe(onSubscribe FnOnSubscribe) SubscriberOption

type Subscription

type Subscription rs.Subscription

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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