Set up handler functions for various events on the GRPC stream.
Parameter | Type | Description |
---|---|---|
event | string | The event name to define a handler for. |
handler | function | The function to call when the event happens. |
Possible events:
Event name | Description |
---|---|
data | Emitted when the server sends data. |
error | Emitted when an error occurs. In case of the error, an Error object sends to the handler function. |
end | Emitted when the server closes the incoming stream. |