mono

package
v0.4.8 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2022 License: MIT Imports: 13 Imported by: 4

Documentation

Overview

Example
gen := func(ctx context.Context, sink mono.Sink) {
	sink.Success("World")
}
mono.
	Create(gen).
	Map(func(i Any) (o Any, err error) {
		o = "Hello " + i.(string) + "!"
		return
	}).
	DoOnNext(func(v Any) error {
		fmt.Println(v)
		return nil
	}).
	Subscribe(context.Background())
Output:

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsSubscribeAsync added in v0.3.1

func IsSubscribeAsync(m Mono) bool

func NewProcessor added in v0.4.2

func NewProcessor(sc scheduler.Scheduler, hook ProcessorFinallyHook) (Mono, Sink, Disposable)

Types

type Any added in v0.2.0

type Any = reactor.Any

Alias

type Disposable added in v0.4.3

type Disposable = reactor.Disposable

Alias

type FlatMapper added in v0.2.4

type FlatMapper = func(reactor.Any) Mono

type Mono

type Mono interface {
	reactor.Publisher
	Filter(reactor.Predicate) Mono
	Map(reactor.Transformer) Mono
	FlatMap(FlatMapper) Mono
	SubscribeOn(scheduler.Scheduler) Mono
	Block(context.Context) (Any, error)
	DoOnNext(reactor.FnOnNext) Mono
	DoOnComplete(reactor.FnOnComplete) Mono
	DoOnSubscribe(reactor.FnOnSubscribe) Mono
	DoOnError(reactor.FnOnError) Mono
	DoOnCancel(reactor.FnOnCancel) Mono
	DoFinally(reactor.FnOnFinally) Mono
	DoOnDiscard(reactor.FnOnDiscard) Mono
	SwitchIfEmpty(alternative Mono) Mono
	SwitchIfError(alternative func(error) Mono) Mono
	SwitchValueIfError(v Any) Mono
	DelayElement(delay time.Duration) Mono
	Timeout(timeout time.Duration) Mono
	Raw() reactor.RawPublisher
}

func Create

func Create(gen func(ctx context.Context, s Sink)) Mono

func CreateOneshot added in v0.3.1

func CreateOneshot(gen func(ctx context.Context, s Sink)) Mono

func Delay added in v0.0.4

func Delay(delay time.Duration) Mono

func Empty added in v0.0.2

func Empty() Mono

func Error added in v0.0.13

func Error(e error) Mono

func ErrorOneshot added in v0.3.1

func ErrorOneshot(e error) Mono

func Just

func Just(v Any) Mono

func JustOneshot added in v0.3.1

func JustOneshot(v Any) Mono

func JustOrEmpty added in v0.0.2

func JustOrEmpty(v Any) Mono

func Zip added in v0.4.0

func Zip(first, second Mono, others ...Mono) Mono

func ZipAll added in v0.4.0

func ZipAll(all ...Mono) Mono

type Processor added in v0.0.3

type Processor interface {
	Mono
	Sink
}

type ProcessorFinallyHook added in v0.4.2

type ProcessorFinallyHook func(reactor.SignalType, reactor.Disposable)

type Sink

type Sink interface {
	Success(Any)
	Error(error)
}

Jump to

Keyboard shortcuts

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