feat: use WithBlock() by default, NonBlock can be set in config or WithNonBlock() (#1198)

This commit is contained in:
Kevin Wan
2021-11-02 19:02:02 +08:00
committed by GitHub
parent b76c7ae55d
commit 1ece3a498f
4 changed files with 25 additions and 1 deletions

View File

@@ -31,6 +31,13 @@ func TestWithRetry(t *testing.T) {
assert.True(t, options.Retry)
}
func TestWithNonBlock(t *testing.T) {
var options ClientOptions
opt := WithNonBlock()
opt(&options)
assert.True(t, options.NonBlock)
}
func TestWithUnaryClientInterceptor(t *testing.T) {
var options ClientOptions
opt := WithUnaryClientInterceptor(func(ctx context.Context, method string, req, reply interface{},