Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Heitor Tashiro Sergent <[email protected]>
  • Loading branch information
olegbespalov and heitortsergent authored Sep 24, 2024
1 parent f650b23 commit ed97368
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Using a gRPC client creates a stream. The client should be connected to the serv
| [Stream.write(message)](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-net-grpc/stream/stream-write) | Writes a message to the stream. |
| [Stream.on(event, handler)](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-net-grpc/stream/stream-on) | Sets up handler functions for various events on the gRPC stream. |
| [Stream.end()](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-net-grpc/stream/stream-end) | Signals to the server that the client has finished sending. |
| [Metadata](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-net-grpc/stream/message-metadata) | An object, the second argument of handler function, with the metadata of a gRPC stream's message. |
| [Metadata](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-net-grpc/stream/message-metadata) | The metadata of a gRPC stream's message. An object that can be passed as the second argument of a handler function. |

### Examples

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ weight: 50

# Message Metadata

Is the metadata object of a gRPC stream's message.
The `Metadata` is an object that represents the gRPC stream's message.

| Name | Type | Description |
| ------------- | ------ | --------------------------------------------------------------------------------------------- |
| `Metadata.ts` | number | Contains the timestamp of the original event (for example, when a message has been received). |
| `Metadata.ts` | number | Contains the timestamp of the original event. For example, when a message has been received. |

### Example

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ 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. The second argument of the handler is message's [`Metadata`](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-net-grpc/stream/message-metadata). |
| handler | function | The function to call when the event happens. The second argument of the handler is the message's [`Metadata`](https://grafana.com/docs/k6/<K6_VERSION>/javascript-api/k6-net-grpc/stream/message-metadata). |

Possible events:

Expand Down

0 comments on commit ed97368

Please sign in to comment.