grpc / grpc/grpc-web

Asynchronous intercept method of StreamInterceptor

Open
#956 5 comments 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
9.3k
Forks
802
Avg merge
1d 7h
Merged PRs (30d)
5

Description

Is it possible to implement promise- or callback- based `intercept` method of `StreamInterceptor` like the `UnaryInterceptor`? For example:

```ts
class StreamAuthInterceptor implements StreamInterceptor {
async intercept(
r: Request,
invoker: (r: Request) => ClientReadableStream
): Promise> {
r.getMetadata()['authorization'] = await getAuth();
return invoker(r);
}
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.