Skip to content

Commit

Permalink
Renamed WithAsyncSend() to WithNoSendWaiting()
Browse files Browse the repository at this point in the history
  • Loading branch information
meling committed Feb 5, 2021
1 parent 017286e commit f340ca8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions callopts.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ func getCallOptions(callType *protoimpl.ExtensionInfo, opts []CallOption) callOp
return o
}

// WithAsyncSend is a CallOption that makes Unicast or Multicast methods
// WithNoSendWaiting is a CallOption that makes Unicast or Multicast methods
// return immediately instead of blocking until the message has been sent.
func WithAsyncSend() CallOption {
func WithNoSendWaiting() CallOption {
return func(o *callOptions) {
o.noSendWaiting = true
}
Expand Down
6 changes: 3 additions & 3 deletions unicast_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func BenchmarkUnicast(b *testing.B) {
})
b.Run("UnicastAsyncSend/NewCall", func(b *testing.B) {
for i := 0; i < b.N; i++ {
unicastNewCall(context.Background(), cd, WithAsyncSend())
unicastNewCall(context.Background(), cd, WithNoSendWaiting())
}
})
b.Run("UnicastSyncSend/Basic", func(b *testing.B) {
Expand All @@ -31,7 +31,7 @@ func BenchmarkUnicast(b *testing.B) {
})
b.Run("UnicastAsyncSend/Basic", func(b *testing.B) {
for i := 0; i < b.N; i++ {
unicastBasic(context.Background(), cd, WithAsyncSend())
unicastBasic(context.Background(), cd, WithNoSendWaiting())
}
})
}
Expand All @@ -43,7 +43,7 @@ func TestUnicast(t *testing.T) {
}
go consumeAndPutResult(cd.rq, cd.sendQ)
unicastBasic(context.Background(), cd)
unicastBasic(context.Background(), cd, WithAsyncSend())
unicastBasic(context.Background(), cd, WithNoSendWaiting())
}

type callData struct {
Expand Down

0 comments on commit f340ca8

Please sign in to comment.