connectable

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package connectable provides a Connectable and its methods.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connectable

type Connectable struct {
	observable.Observable
	// contains filtered or unexported fields
}

Connectable is an Observable which can subscribe several EventHandlers before starting processing with Connect.

func Empty

func Empty() Connectable

Empty creates a Connectable with no item and terminate immediately.

func From

func From(it rx.Iterator) Connectable

From creates a Connectable from an Iterator.

func Interval

func Interval(term chan struct{}, timeout time.Duration) Connectable

Interval creates a Connectable emitting incremental integers infinitely between each given time interval.

func Just

func Just(item interface{}, items ...interface{}) Connectable

Just creates an Connectable with the provided item(s).

func New

func New(buffer uint, observers ...observer.Observer) Connectable

New creates a Connectable with optional observer(s) as parameters.

func Range

func Range(start, end int) Connectable

Range creates an Connectable that emits a particular range of sequential integers.

func Start

Start creates a Connectable from one or more directive-like EmittableFunc and emits the result of each operation asynchronously on a new Connectable.

func (Connectable) Connect

func (co Connectable) Connect() <-chan (chan subscription.Subscription)

Connect activates the Observable stream and returns a channel of Subscription channel.

func (Connectable) Distinct

func (co Connectable) Distinct(apply fx.KeySelectorFunc) Connectable

Distinct suppress duplicate items in the original Connectable and returns a new Connectable.

func (Connectable) DistinctUntilChanged

func (co Connectable) DistinctUntilChanged(apply fx.KeySelectorFunc) Connectable

DistinctUntilChanged suppress duplicate items in the original Connectable only if they are successive to one another and returns a new Connectable.

func (Connectable) Do

func (co Connectable) Do(nextf func(interface{})) Connectable

Do is like Subscribe but subscribes a func(interface{}) as a NextHandler

func (Connectable) Filter

func (co Connectable) Filter(fn fx.FilterableFunc) Connectable

Filter filters items in the original Connectable and returns a new Connectable with the filtered items.

func (Connectable) First

func (co Connectable) First() Connectable

First returns new Connectable which emits only first item.

func (Connectable) Last

func (co Connectable) Last() Connectable

Last returns a new Connectable which emits only last item.

func (Connectable) Map

Map maps a MappableFunc predicate to each item in Connectable and returns a new Connectable with applied items.

func (Connectable) Scan

func (co Connectable) Scan(apply fx.ScannableFunc) Connectable

Scan applies ScannableFunc predicate to each item in the original Connectable sequentially and emits each successive value on a new Connectable.

func (Connectable) Subscribe

func (co Connectable) Subscribe(handler rx.EventHandler) Connectable

Subscribe subscribes an EventHandler and returns a Connectable.

Jump to

Keyboard shortcuts

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