Skip to content

Commit cfb3283

Browse files
committed
fix formatting and spacing in config.yml for better readability and clarity
1 parent b905782 commit cfb3283

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

solutions/gleam/02-rg2/config.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ hints:
22
- title_markdown: "How do I access the client's TCP connection?"
33
body_markdown: |-
44
Use the [`handler()`](https://hexdocs.pm/glisten/glisten.html#handler) callbacks to access the client's connection:
5-
5+
66
```gleam
77
glisten.handler(
88
fn(_conn) { #(Nil, None) }, // Connection handler
@@ -11,18 +11,18 @@ hints:
1111
}
1212
)
1313
```
14-
14+
1515
The second callback receives messages from the client along with the `conn` (connection) parameter.n`.
1616
- title_markdown: "How do I send a response to the client?"
1717
body_markdown: |-
1818
Use the [`send()`](https://hexdocs.pm/glisten/glisten.html#send) function to send a response to the client:
19-
19+
2020
```gleam
2121
import gleam/bytes_builder
22-
22+
2323
let assert Ok(_) = glisten.send(conn, bytes_builder.from_string("+PONG\r\n"))
2424
```
25-
26-
- Use `bytes_builder.from_string()` to convert the string to bytes.
25+
26+
- Use `bytes_builder.from_string()` to convert the string to bytes.
2727
- `+PONG\r\n` is the string "PONG" encodedOptionalas a [RESP simple string](https://redis.io/docs/latest/develop/reference/protocol-spec/#simple-strings).
2828
- Send the response inside the message handler (second callback), not the connection handler.

0 commit comments

Comments
 (0)