Documentation
¶
Index ¶
- func ExecuteAsync(n int, f func(i int) (interface{}, error)) ([]interface{}, error)
- func ExecuteOrderedAsync(n int, f func(i int) (interface{}, error)) ([]interface{}, error)
- func GetPartitionIndex(key string, partitions int) (int, error)
- func IterAsync(n int, f func(i int) error) error
- func RetryingStreamClientInterceptor(duration time.Duration) ...
- func RetryingUnaryClientInterceptor() func(ctx context.Context, method string, req, reply interface{}, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExecuteAsync ¶
ExecuteAsync executes the given function f up to n times concurrently, populating the given results slice with the results of each function call. Each call is done in a separate goroutine. On each iteration, the function f will be called with a unique sequential index i such that the index can be used to reference an element in an array or slice. If an error is returned by the function f for any index, an error will be returned. Otherwise, a nil result will be returned once all function calls have completed.
func ExecuteOrderedAsync ¶
ExecuteOrderedAsync executes the given function f up to n times concurrently, populating the given results slice with the results of each function call. Each call is done in a separate goroutine. On each iteration, the function f will be called with a unique sequential index i such that the index can be used to reference an element in an array or slice. If an error is returned by the function f for any index, an error will be returned. Otherwise, a nil result will be returned once all function calls have completed.
func GetPartitionIndex ¶
GetPartitionIndex returns the index of the partition for the given key
func IterAsync ¶
IterAsync executes the given function f up to n times concurrently. Each call is done in a separate goroutine. On each iteration, the function f will be called with a unique sequential index i such that the index can be used to reference an element in an array or slice. If an error is returned by the function f for any index, an error will be returned. Otherwise, a nil result will be returned once all function calls have completed.
func RetryingStreamClientInterceptor ¶
func RetryingStreamClientInterceptor(duration time.Duration) func(ctx context.Context, desc *grpc.StreamDesc, cc *grpc.ClientConn, method string, streamer grpc.Streamer, opts ...grpc.CallOption) (grpc.ClientStream, error)
RetryingStreamClientInterceptor returns a ClientStreamInterceptor that retries both requests and responses
func RetryingUnaryClientInterceptor ¶
func RetryingUnaryClientInterceptor() func(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error
RetryingUnaryClientInterceptor returns a UnaryClientInterceptor that retries requests
Types ¶
This section is empty.