Skip to content

Commit

Permalink
Add a little sketch of how BatchTransformationFunction fits in
Browse files Browse the repository at this point in the history
  • Loading branch information
colmsnowplow committed May 24, 2024
1 parent b41c83f commit a2789b0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion cmd/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,15 @@ func sourceWriteFunc(t targetiface.Target, ft failureiface.Failure, tr transform
messageBatches := []*models.TargetBatch{
&models.TargetBatch{
OriginalMessages: messagesToSend,
HTTPRequestBody: nil}}
HTTPRequestBody: nil},
}

BatchTransformationFunction := func(b []*models.TargetBatch) []*models.TargetBatch {

// imaine this is composable like transformaion functions, and does something :D
return b
}
messageBatches = BatchTransformationFunction(messageBatches)

res, err := retry.ExponentialWithInterface(5, time.Second, "target.Write", func() (interface{}, error) {
res, err := t.Write(messageBatches)
Expand Down

0 comments on commit a2789b0

Please sign in to comment.