LoginSignup
0
0

More than 5 years have passed since last update.

Node.jsでgRPCを使うときのメモ

Posted at

コード生成

dyhnamicにコード生成する場合は、 Protobuf.js を使う
staticに事前にコード生成する場合は、 protoc を使う

参考
https://grpc.io/docs/tutorials/basic/node.html#example-code-and-setup

クライアントの非同期ハンドリング

eventまたは、callbackを使う

simple callのときはcallbackでよいが、streamのときは複数回結果を受け取る必要があるのでeventを使う
公式サンプルで使い分けが示されてるので、一度呼んだほうがわかりやすい

クライアント実装のサンプル

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0