-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3bdd3b4
commit ed1692b
Showing
3 changed files
with
72 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |