99 "go.uber.org/cadence/internal"
1010)
1111
12- // BatchFutureImpl is an implementation of BatchFuture
13- type BatchFutureImpl struct {
12+ // BatchFuture is an implementation of public BatchFuture interface.
13+ type BatchFuture struct {
1414 futures []internal.Future
1515 settables []internal.Settable
1616 factories []func (ctx internal.Context ) internal.Future
@@ -20,7 +20,7 @@ type BatchFutureImpl struct {
2020 wg internal.WaitGroup
2121}
2222
23- func NewBatchFuture (ctx internal.Context , batchSize int , factories []func (ctx internal.Context ) internal.Future ) (* BatchFutureImpl , error ) {
23+ func NewBatchFuture (ctx internal.Context , batchSize int , factories []func (ctx internal.Context ) internal.Future ) (* BatchFuture , error ) {
2424 var futures []internal.Future
2525 var settables []internal.Settable
2626 for range factories {
@@ -29,7 +29,7 @@ func NewBatchFuture(ctx internal.Context, batchSize int, factories []func(ctx in
2929 settables = append (settables , settable )
3030 }
3131
32- batchFuture := & BatchFutureImpl {
32+ batchFuture := & BatchFuture {
3333 futures : futures ,
3434 settables : settables ,
3535 factories : factories ,
@@ -41,11 +41,11 @@ func NewBatchFuture(ctx internal.Context, batchSize int, factories []func(ctx in
4141 return batchFuture , nil
4242}
4343
44- func (b * BatchFutureImpl ) GetFutures () []internal.Future {
44+ func (b * BatchFuture ) GetFutures () []internal.Future {
4545 return b .futures
4646}
4747
48- func (b * BatchFutureImpl ) start (ctx internal.Context ) {
48+ func (b * BatchFuture ) start (ctx internal.Context ) {
4949
5050 buffered := internal .NewBufferedChannel (ctx , b .batchSize ) // buffered channel to limit the number of concurrent futures
5151 channel := internal .NewNamedChannel (ctx , "batch-future-channel" )
@@ -87,7 +87,7 @@ func (b *BatchFutureImpl) start(ctx internal.Context) {
8787 })
8888}
8989
90- func (b * BatchFutureImpl ) IsReady () bool {
90+ func (b * BatchFuture ) IsReady () bool {
9191 for _ , future := range b .futures {
9292 if ! future .IsReady () {
9393 return false
@@ -101,7 +101,7 @@ func (b *BatchFutureImpl) IsReady() bool {
101101// If valuePtr is a pointer to a slice, the slice will be resized to the length of the futures. Each element of the slice will be assigned with the underlying Future.Get() and thus behaves the same way.
102102// If valuePtr is nil, no assignment will be made.
103103// If error occurs, values will be set on successful futures and the errors of failed futures will be returned.
104- func (b * BatchFutureImpl ) Get (ctx internal.Context , valuePtr interface {}) error {
104+ func (b * BatchFuture ) Get (ctx internal.Context , valuePtr interface {}) error {
105105 // No assignment if valuePtr is nil
106106 if valuePtr == nil {
107107 b .wg .Wait (ctx )
0 commit comments