restartstream

package
v0.0.0-...-b349366 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 7, 2020 License: MIT Imports: 10 Imported by: 20

Documentation

Index

Constants

This section is empty.

Variables

DefaultSettings for Interceptor

View Source
var ErrStreamClosed = errors.New("grpc: stream closed")

ErrStreamClosed is returned when trying to call SendMsg or RecvMsg on a closed stream

Functions

func Interceptor

func Interceptor(settings Settings) grpc.StreamClientInterceptor

Interceptor automatically restarts streams on non-expected errors To do so, the application should create a for-loop around RecvMsg, which returns the same errors that are received from the server.

An io.EOF indicates the end of the stream

To stop the reconnect behaviour, you have to cancel the context

Types

type Settings

type Settings struct {
	RetryableCodes []codes.Code
	Backoff        backoff.Config
}

Settings for Interceptor

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL