Skip to content

Commit

Permalink
wip (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreasChristianson committed Nov 20, 2023
1 parent 3bdd3b4 commit ed1692b
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 38 deletions.
18 changes: 18 additions & 0 deletions examples/literals.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package main

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

func main() {
pipe := reactive.Just("Hello", " ", "world")
pipe.UponClose(func() {
println("!")
})
pipe.Observe(func(item string) error {
print(item)
return nil
})
<-time.After(time.Millisecond)
}
57 changes: 19 additions & 38 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,43 +1,24 @@
# Gopher Pipes

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

### CI
[![main-build](https://github.com/AndreasChristianson/gopher-pipes/actions/workflows/main-build.yaml/badge.svg)](https://github.com/AndreasChristianson/gopher-pipes/actions/workflows/main-build.yaml)
![coverage](https://raw.githubusercontent.com/AndreasChristianson/gopher-pipes/badges/.badges/main/coverage.svg)

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

## Import

```shell
go get github.com/AndreasChristianson/gopher-pipes
```

## Usage

### simple

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

- [ ] features
- [x] map
- [x] buffer
- [x] generator
- [ ] reduce
- [ ] peek/tap
- [ ] readme
- [ ] examples
- [ ] getting started
- [x] coverage badge
- [ ] how should we handle errors?
- [ ] in sinks
- [x] in sources
- [ ] backpressure
- [x] retries
- [x] exponential backoff
- [x] configurable
- [x] only register a sink once
- [x] hard errors vs soft errors
- [x] don't start right away
- actually starting right away is better
- [ ] pass a context
- [ ] logging
- [ ] option to squelch
- [ ] option to collect till pipe completes
- [ ] option to record metrics
- [ ] option for verbose
- [x] ci
- [x] code coverage
- [x] cut versions
- [ ] document
- [x] get us into golang docs
- [x] comments with links

underTest := Just("Hello")
```
35 changes: 35 additions & 0 deletions todo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# todo

- [ ] features
- [x] map
- [x] buffer
- [x] generator
- [ ] reduce
- [ ] peek/tap
- [ ] readme
- [ ] examples
- [ ] getting started
- [x] coverage badge
- [ ] how should we handle errors?
- [ ] in sinks
- [x] in sources
- [ ] backpressure
- [x] retries
- [x] exponential backoff
- [x] configurable
- [x] only register a sink once
- [x] hard errors vs soft errors
- [x] don't start right away
- actually starting right away is better
- [ ] pass a context
- [ ] logging
- [ ] option to squelch
- [ ] option to collect till pipe completes
- [ ] option to record metrics
- [ ] option for verbose
- [x] ci
- [x] code coverage
- [x] cut versions
- [ ] document
- [x] get us into golang docs
- [x] comments with links

0 comments on commit ed1692b

Please sign in to comment.