grpc.io
grpc.io copied to clipboard
Node.js basics: `Reader` interface or `Readable` interface
While going through the docs for Node.js basics tutorial, I found a slight inconsistency.
Under the subsection "Implementing RouteGuide", it says the following under the listFeatures(call) function definition code:
As you can see, instead of getting the call object and callback in our method parameters, this time we get a call object that implements the
Writableinterface. In the method, we create as many Feature objects as we need to return, writing them to the call using its write() method. Finally, we call call.end() to indicate that we have sent all messages.If you look at the client-side streaming method RecordRoute you’ll see it’s quite similar to the unary call, except this time the call parameter implements the
Readerinterface. The call’s 'data' event fires every time there is new data, and the 'end' event fires when all data has been read. Like the unary case, we respond by calling the callback...
In the first paragraph, the name of the interface is Writable, while in the second paragraph it is the Reader interface. For clarification, I looked at the example code referenced in this article, where the word Readable has been used.
Is Reader something separate, or is it just a minor inconsistency? If it's the latter, I would be happy to fix it (that is, if Readable was the intended name.)
CC @murgatroid99
Yes, it's supposed to be Readable. Specifically, this is referring to Node's built in stream.Writable and stream.Readable classes.
@murgatroid99, you can change https://github.com/grpc/grpc.io/blob/main/content/en/docs/languages/node/basics.md
Ping @murgatroid99