mono

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2020 License: MIT Imports: 10 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

This section is empty.

Types

type Any added in v0.2.0

type Any = reactor.Any

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
	DelayElement(delay time.Duration) Mono
	Timeout(timeout time.Duration) Mono
}

func Create

func Create(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 Just

func Just(v Any) Mono

func JustOrEmpty added in v0.0.2

func JustOrEmpty(v Any) Mono

type Processor added in v0.0.3

type Processor interface {
	Mono
	Sink
}

func CreateProcessor added in v0.0.3

func CreateProcessor() Processor

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