mono

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2019 License: MIT Imports: 10 Imported by: 4

Documentation

Overview

Example
package main

import (
	"context"
	"fmt"

	"github.com/jjeffcaii/reactor-go/mono"
)

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

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mono

type Mono interface {
	rs.Publisher
	Filter(rs.Predicate) Mono
	Map(rs.Transformer) Mono
	FlatMap(flatMapper) Mono
	SubscribeOn(scheduler.Scheduler) Mono
	Block(context.Context) (interface{}, error)
	DoOnNext(rs.FnOnNext) Mono
	DoOnComplete(rs.FnOnComplete) Mono
	DoOnSubscribe(rs.FnOnSubscribe) Mono
	DoOnError(rs.FnOnError) Mono
	DoOnCancel(rs.FnOnCancel) Mono
	DoFinally(rs.FnOnFinally) Mono
	DoOnDiscard(rs.FnOnDiscard) Mono
	SwitchIfEmpty(alternative Mono) Mono
	DelayElement(delay 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 interface{}) Mono

func JustOrEmpty added in v0.0.2

func JustOrEmpty(v interface{}) 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(interface{})
	Error(error)
}

Jump to

Keyboard shortcuts

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