Categorygithub.com/AndreasChristianson/gopher-pipes
repositorypackage
0.5.5
Repository: https://github.com/andreaschristianson/gopher-pipes.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author

# README

Gopher Pipes

main-build coverage Go Reference

Simple source/sink abstraction around generator functions, channels, and observing.

Import

go get github.com/AndreasChristianson/gopher-pipes

Usage

see the examples folder for more examples.

simple

This example creates a source with four strings, observes them, and prints the observed strings. Verbose logging is enabled.

package main

import (
	"fmt"
	"github.com/AndreasChristianson/gopher-pipes/reactive"
)

func main() {
	pipe := reactive.Just("Hello", " ", "world", "!\n")
	pipe.Observe(func(item string) error {
		fmt.Print(item)
		return nil
	})
	pipe.Start()
	pipe.AwaitCompletion()
}

complicated

This example polls a persistent redis stream using XREAD (via go-redis) and routes messages to a websocket

// todo