Socket
Socket
Sign inDemoInstall

github.com/AndreasChristianson/gopher-pipes

Package Overview
Dependencies
6
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

    github.com/AndreasChristianson/gopher-pipes

Package gopher_pipes provides utilities for reactive programming in golang


Version published

Readme

Source

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

FAQs

Last updated on 23 Nov 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc