Skip to content

Commit

Permalink
fix typos, thanks claude!
Browse files Browse the repository at this point in the history
  • Loading branch information
matklad committed Sep 25, 2024
1 parent c461125 commit 7ce4265
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions content/posts/2024-09-24-watermelon-operator.dj
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ a promise is created. In contrast, Rust futures are lazy --- they do nothing unt
_this_ I think is the fundamental difference, it is lazy vs. eager "futures" (`thread::spawn` is an
eager "future" while `rayon::join` a lazy one).

And it seems that lazy semantics is quiet a bit more elegant! The beauty of
And it seems that lazy semantics is quite a bit more elegant! The beauty of

```rust
join(
Expand Down Expand Up @@ -325,7 +325,7 @@ concurrently let Some(socket) = listener.accept().await in {
```

This runs accept in a loop, and, for each accepted socket, runs `handle_connection` concurrently.
There are as many concurrent `handle_connection`s calls as there are ready sockets in our listener!
There are as many concurrent `handle_connection` calls as there are ready sockets in our listener!

Let's limit the maximum number of concurrent connections, to provide back pressure:

Expand All @@ -346,7 +346,7 @@ in {

You get the idea (hopefully):

- In the "head" of our concurrent loop (cooloop?) construct, we first aquire a semaphore permit
- In the "head" of our concurrent loop (cooloop?) construct, we first acquire a semaphore permit
and then fetch a socket.
- Both the socket and the permit are passed to the body.
- The body releases the permit at the end.
Expand Down

0 comments on commit 7ce4265

Please sign in to comment.