ydb-platform / ydb-go-sdk

Pure Go native and database/sql driver for YDB
https://ydb.tech
Apache License 2.0
133 stars 69 forks source link

feat: Callback interface for topic reader #1269

Open rekby opened 1 month ago

rekby commented 1 month ago

Feature Request

Describe the Feature Request

Available to set callback function as callback for receive new messages. It will allow to easy parallel works


f := func(ctx, batch topicreader.MessageBatch) (action, error){
  return topicreader.ActionCommit, nil
}

reader, err := client.StartReader(ctx, ..., WithCallback(f))

callback f can be called within many goroutines - one goroutine by partition.

it will be mach simpler if need to parallel work.