Skip to content

Commit

Permalink
Changed example a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
destel committed Mar 20, 2024
1 parent e93bb72 commit 7f4e12c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func printValuesFromRedis(ctx context.Context, urls []string) error {

// Fetch and stream keys from each URL concurrently
keys := rill.FlatMap(urlsChan, 10, func(url string) <-chan rill.Try[string] {
return streamKeys(ctx, url)
return streamLines(ctx, url)
})

// Exclude any empty keys from the stream
Expand Down Expand Up @@ -92,8 +92,8 @@ func printValuesFromRedis(ctx context.Context, urls []string) error {
return nil
}

// streamKeys reads a file from the given URL line by line and returns a channel of lines/keys
func streamKeys(ctx context.Context, url string) <-chan rill.Try[string] {
// streamLines reads a file from the given URL line by line and returns a channel of lines
func streamLines(ctx context.Context, url string) <-chan rill.Try[string] {
// ...
}

Expand Down
6 changes: 3 additions & 3 deletions examples/redis-read/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func printValuesFromRedis(ctx context.Context, urls []string) error {

// Fetch and stream keys from each URL concurrently
keys := rill.FlatMap(urlsChan, 10, func(url string) <-chan rill.Try[string] {
return streamKeys(ctx, url)
return streamLines(ctx, url)
})

// Exclude any empty keys from the stream
Expand Down Expand Up @@ -91,8 +91,8 @@ func printValuesFromRedis(ctx context.Context, urls []string) error {
return nil
}

// streamKeys reads a file from the given URL line by line and returns a channel of lines/keys
func streamKeys(ctx context.Context, url string) <-chan rill.Try[string] {
// streamLines reads a file from the given URL line by line and returns a channel of lines
func streamLines(ctx context.Context, url string) <-chan rill.Try[string] {
out := make(chan rill.Try[string], 1)

go func() {
Expand Down

0 comments on commit 7f4e12c

Please sign in to comment.