From 7ce4265d553c3c506a81549850d0c6f5101d0609 Mon Sep 17 00:00:00 2001 From: Alex Kladov Date: Wed, 25 Sep 2024 13:34:21 +0100 Subject: [PATCH] fix typos, thanks claude! --- content/posts/2024-09-24-watermelon-operator.dj | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/content/posts/2024-09-24-watermelon-operator.dj b/content/posts/2024-09-24-watermelon-operator.dj index 40ba40da..702ecbcb 100644 --- a/content/posts/2024-09-24-watermelon-operator.dj +++ b/content/posts/2024-09-24-watermelon-operator.dj @@ -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( @@ -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: @@ -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.