Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ServerDuplexStream documentation error (no members listed) #114

Open
mag415 opened this issue Dec 6, 2017 · 4 comments
Open

ServerDuplexStream documentation error (no members listed) #114

mag415 opened this issue Dec 6, 2017 · 4 comments
Assignees

Comments

@mag415
Copy link

mag415 commented Dec 6, 2017

There isn't a metadata property in ServerDuplexStream. How can I get the metadata from the client request?

@murgatroid99
Copy link
Member

ServerDuplexStream should have a metadata property. Can you show the code that you're using to try to access it?

@murgatroid99 murgatroid99 self-assigned this Dec 6, 2017
@mag415
Copy link
Author

mag415 commented Dec 6, 2017

The JsDoc for ServerDuplexStream doesn't have any members listed.
https://grpc.io/grpc/node/grpc-ServerDuplexStream.html

While ServerReadableStream has metadata listed.
https://grpc.io/grpc/node/grpc-ServerReadableStream.html

Moreover, index.d.ts (I'm using typescript) from the npm package (1.7.2) has ServerDuplexStream defined as:

  /**
   * A stream that the server can read from or write to. Used for calls
   * with duplex streaming.
   */
  export class ServerDuplexStream extends Duplex {
    private constructor();

    /**
     * Get the endpoint this call/stream is connected to.
     * @return The URI of the endpoint
     */
    getPeer(): string;

    /**
     * Send the initial metadata for a writable stream.
     * @param responseMetadata Metadata to send
     */
    sendMetadata(responseMetadata: Metadata): void;
  }

@murgatroid99
Copy link
Member

That's an error in the documentation, and the documentation was used to write the index.d.ts file.

@mag415
Copy link
Author

mag415 commented Dec 6, 2017

Makes sense. Thanks!

@mag415 mag415 closed this as completed Dec 6, 2017
@mag415 mag415 reopened this Dec 6, 2017
@mag415 mag415 changed the title Getting client metadata from ServerDuplexStream? ServerDuplexStream documentation error (no members listed) Dec 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants