Skip to content

Commit 88f4909

Browse files
authored
feat(writers): Add streamingbatchwriter.Unimplemented* handlers (#1022)
1 parent d11dd56 commit 88f4909

File tree

2 files changed

+27
-7
lines changed

2 files changed

+27
-7
lines changed

writers/streamingbatchwriter/streamingbatchwriter.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -384,13 +384,6 @@ func (s *streamingWorkerManager[T]) run(ctx context.Context, wg *sync.WaitGroup,
384384
}
385385
}
386386

387-
// DummyHandler should be used to empty Migration and DeleteStale channels if they are not used.
388-
func DummyHandler[T message.WriteMessage](ch <-chan T) {
389-
// nolint:revive
390-
for range ch {
391-
}
392-
}
393-
394387
func timer(timeout time.Duration) <-chan time.Time {
395388
if timeout == 0 {
396389
return nil
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package streamingbatchwriter
2+
3+
import (
4+
"context"
5+
6+
"github.com/cloudquery/plugin-sdk/v4/message"
7+
)
8+
9+
// UnimplementedMigrateTable is a dummy handler to consume WriteMigrateTable messages
10+
type UnimplementedMigrateTable struct{}
11+
12+
func (UnimplementedMigrateTable) MigrateTable(_ context.Context, ch <-chan *message.WriteMigrateTable) error {
13+
// nolint:revive
14+
for range ch {
15+
}
16+
return nil
17+
}
18+
19+
// UnimplementedDeleteStale is a dummy handler to consume DeleteStale messages
20+
type UnimplementedDeleteStale struct{}
21+
22+
func (UnimplementedDeleteStale) DeleteStale(_ context.Context, ch <-chan *message.WriteDeleteStale) error {
23+
// nolint:revive
24+
for range ch {
25+
}
26+
return nil
27+
}

0 commit comments

Comments
 (0)