diff options
Diffstat (limited to 'vendor/google.golang.org/grpc/tap')
-rw-r--r-- | vendor/google.golang.org/grpc/tap/tap.go | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/vendor/google.golang.org/grpc/tap/tap.go b/vendor/google.golang.org/grpc/tap/tap.go index decb678..584360f 100644 --- a/vendor/google.golang.org/grpc/tap/tap.go +++ b/vendor/google.golang.org/grpc/tap/tap.go | |||
@@ -21,7 +21,7 @@ | |||
21 | package tap | 21 | package tap |
22 | 22 | ||
23 | import ( | 23 | import ( |
24 | "golang.org/x/net/context" | 24 | "context" |
25 | ) | 25 | ) |
26 | 26 | ||
27 | // Info defines the relevant information needed by the handles. | 27 | // Info defines the relevant information needed by the handles. |
@@ -32,8 +32,20 @@ type Info struct { | |||
32 | // TODO: More to be added. | 32 | // TODO: More to be added. |
33 | } | 33 | } |
34 | 34 | ||
35 | // ServerInHandle defines the function which runs when a new stream is created | 35 | // ServerInHandle defines the function which runs before a new stream is created |
36 | // on the server side. Note that it is executed in the per-connection I/O goroutine(s) instead | 36 | // on the server side. If it returns a non-nil error, the stream will not be |
37 | // of per-RPC goroutine. Therefore, users should NOT have any blocking/time-consuming | 37 | // created and a RST_STREAM will be sent back to the client with REFUSED_STREAM. |
38 | // work in this handle. Otherwise all the RPCs would slow down. | 38 | // The client will receive an RPC error "code = Unavailable, desc = stream |
39 | // terminated by RST_STREAM with error code: REFUSED_STREAM". | ||
40 | // | ||
41 | // It's intended to be used in situations where you don't want to waste the | ||
42 | // resources to accept the new stream (e.g. rate-limiting). And the content of | ||
43 | // the error will be ignored and won't be sent back to the client. For other | ||
44 | // general usages, please use interceptors. | ||
45 | // | ||
46 | // Note that it is executed in the per-connection I/O goroutine(s) instead of | ||
47 | // per-RPC goroutine. Therefore, users should NOT have any | ||
48 | // blocking/time-consuming work in this handle. Otherwise all the RPCs would | ||
49 | // slow down. Also, for the same reason, this handle won't be called | ||
50 | // concurrently by gRPC. | ||
39 | type ServerInHandle func(ctx context.Context, info *Info) (context.Context, error) | 51 | type ServerInHandle func(ctx context.Context, info *Info) (context.Context, error) |