Skip to content

Commit

Permalink
Reuse
Browse files Browse the repository at this point in the history
  • Loading branch information
nathan-artie committed Mar 30, 2024
1 parent d867c5c commit 9a17082
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions lib/writer/writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,9 @@ import (

"github.com/artie-labs/reader/destinations"
"github.com/artie-labs/reader/lib"
"github.com/artie-labs/reader/lib/iterator"
)

type RawMessageIterator interface {
HasNext() bool
Next() ([]lib.RawMessage, error)
}

type Writer struct {
destination destinations.Destination
logProgress bool
Expand All @@ -25,7 +21,7 @@ func New(destination destinations.Destination, logProgress bool) Writer {
}

// Write writes all the messages from an iterator to the destination.
func (w *Writer) Write(ctx context.Context, iter RawMessageIterator) (int, error) {
func (w *Writer) Write(ctx context.Context, iter iterator.Iterator[[]lib.RawMessage]) (int, error) {
start := time.Now()
var count int
for iter.HasNext() {
Expand Down

0 comments on commit 9a17082

Please sign in to comment.