func (si streamServerInterceptor) Interceptor() grpc.StreamServerInterceptor {
	return func(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error {
		// TODO: Find a more efficient way
		interceptor := handler
		si.lock.RLock()
		for idx := len(si.interceptors) - 1; idx >= 0; idx-- {
			interceptor = chainStreamServerInterceptor(si.interceptors[idx], info, interceptor)
		}
		si.lock.RUnlock()
		return interceptor(srv, ss)
	}
}
// Interceptor chains all added interceptors into a single
// `grpc.StreamServerInterceptor`.
//
// The `handler` passed to each interceptor is either the next interceptor or,
// for the last element of the chain, the target method.
Interceptor chains all added interceptors into a single
`grpc.StreamServerInterceptor`.

The `handler` passed to each interceptor is either the next interceptor or,
for the last element of the chain, the target method.
// Interceptor chains all added interceptors into a single // ` grpc . StreamServerInterceptor ` . // // The ` handler ` passed to each interceptor is either the next interceptor or // for the last element of the chain the target method .
func (si streamServerInterceptor) Interceptor() grpc.StreamServerInterceptor {
	return func(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error {
		interceptor := handler
		si.lock.RLock()
		for idx := len(si.interceptors) - 1; idx >= 0; idx-- {
			interceptor = chainStreamServerInterceptor(si.interceptors[idx], info, interceptor)
		}
		si.lock.RUnlock()
		return interceptor(srv, ss)
	}
}
func ( si streamServerInterceptor ) Interceptor ( ) grpc . StreamServerInterceptor { return func ( srv interface { } , ss grpc . ServerStream , info * grpc . StreamServerInfo , handler grpc . StreamHandler ) error { interceptor := handler si . lock . RLock ( ) for idx := len ( si . interceptors ) - 1 ; idx >= 0 ; idx -- { interceptor = chainStreamServerInterceptor ( si . interceptors [ idx ] , info , interceptor ) } si . lock . RUnlock ( ) return interceptor ( srv , ss ) } }
Interceptor chains all added interceptors into a single
`grpc.StreamServerInterceptor`.
Interceptor chains all added interceptors into a single ` grpc . StreamServerInterceptor ` .
// TODO: Find a more efficient way