rx

package
v0.0.0-...-f1d979d Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2018 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunAsync

func RunAsync(ctx context.Context, fun func(context.Context)) io.Closer

RunAsync runs `fun` asynchronously. The return value can be used to terminate the execution of the asynchronous method. The Close method of returned value ensures that the asynchronous function has finished its work.

func RunAsyncObserver

func RunAsyncObserver(ctx context.Context, o Observer, fun func(context.Context) error) io.Closer

RunAsyncObserver runs `fun` asynchronously and, when it’s finished, calls the appropriate observer method OnError/OnCompleted, depending on the result/error. The function `fun` should use only OnNext method of observer. The return value can be used to terminate the execution of the asynchronous method. The Close method of returned value ensures that the asynchronous function has finished its work.

Types

type Observer

type Observer interface {
	// OnError notifies the observer that the provider has experienced an error condition.
	OnError(err error)
	// OnCompleted notifies the observer that the provider has finished sending push-based notifications.
	OnCompleted()
}

Observer provides a mechanism for receiving push-based notifications.

Jump to

Keyboard shortcuts

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