Skip to content

Commit 8d03db5

Browse files
committed
rename to ofainin
1 parent b579397 commit 8d03db5

File tree

6 files changed

+16
-16
lines changed

6 files changed

+16
-16
lines changed

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Concurrent ordered processing
1+
# Ordered Fan-In
22
You can use this `oproc` package when you want to speed up processing with goroutines
33
while guaranteeing ordering.
44

@@ -13,14 +13,14 @@ import (
1313
"math/rand"
1414
"time"
1515

16-
"github.com/sjnam/oproc"
16+
"github.com/sjnam/ofanin"
1717
)
1818

1919
func main() {
2020
ctx, cancel := context.WithCancel(context.TODO())
2121
defer cancel()
2222

23-
my := oproc.NewOrderedProc[string /*input param*/, string /*output param*/](ctx)
23+
my := ofanin.NewOrderedFanIn[string /*input param*/, string /*output param*/](ctx)
2424
my.InputStream = func() <-chan string {
2525
ch := make(chan string)
2626
go func() {

examples/ctan/main.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"log"
88
"net/http"
99

10-
"github.com/sjnam/oproc"
10+
"github.com/sjnam/ofanin"
1111
)
1212

1313
type item struct {
@@ -26,7 +26,7 @@ func main() {
2626
ctx, cancel := context.WithCancel(context.TODO())
2727
defer cancel()
2828

29-
my := oproc.NewOrderedProc[item /*input param*/, item /*output param*/](ctx)
29+
my := ofanin.NewOrderedFanIn[item /*input param*/, item /*output param*/](ctx)
3030
my.InputStream = func() <-chan item {
3131
valStream := make(chan item)
3232
go func() {

examples/ordered/main.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ import (
66
"math/rand"
77
"time"
88

9-
"github.com/sjnam/oproc"
9+
"github.com/sjnam/ofanin"
1010
)
1111

1212
func main() {
1313
ctx, cancel := context.WithCancel(context.TODO())
1414
defer cancel()
1515

16-
my := oproc.NewOrderedProc[string /*input param*/, string /*output param*/](ctx)
16+
my := ofanin.NewOrderedFanIn[string /*input param*/, string /*output param*/](ctx)
1717
my.InputStream = func() <-chan string {
1818
ch := make(chan string)
1919
go func() {

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
module github.com/sjnam/oproc
1+
module github.com/sjnam/ofanin
22

33
go 1.23.4

oproc.go ofanin.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
package oproc
1+
package ofanin
22

33
import (
44
"context"
55
"runtime"
66
)
77

8-
type OrderedProc[TI /*input param type*/, TO /*output param type*/ any] struct {
8+
type OrderedFanIn[TI /*input param type*/, TO /*output param type*/ any] struct {
99
Ctx context.Context
1010
InputStream <-chan TI
1111
DoWork func(TI) TO
1212
Size int
1313
}
1414

15-
func NewOrderedProc[TI, TO any](ctx context.Context) *OrderedProc[TI, TO] {
16-
return &OrderedProc[TI, TO]{
15+
func NewOrderedFanIn[TI, TO any](ctx context.Context) *OrderedFanIn[TI, TO] {
16+
return &OrderedFanIn[TI, TO]{
1717
Ctx: ctx,
1818
Size: runtime.NumCPU(),
1919
}
2020
}
2121

22-
func (o *OrderedProc[TI, TO]) Process() <-chan TO {
22+
func (o *OrderedFanIn[TI, TO]) Process() <-chan TO {
2323
orDone := func(c <-chan TO) <-chan TO {
2424
ch := make(chan TO)
2525
go func() {

oproc_test.go ofanin_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
package oproc
1+
package ofanin
22

33
import (
44
"context"
55
"fmt"
66
)
77

8-
func ExampleOrderedProc() {
8+
func ExampleOrderedFanIn() {
99
ctx, cancel := context.WithCancel(context.TODO())
1010
defer cancel()
1111

12-
my := NewOrderedProc[string /*input param*/, string /*output param*/](ctx)
12+
my := NewOrderedFanIn[string /*input param*/, string /*output param*/](ctx)
1313
my.InputStream = func() <-chan string {
1414
ch := make(chan string)
1515
go func() {

0 commit comments

Comments
 (0)