From fc13f5eef572cb98462bdfd7630b1b99d3bf0b0f Mon Sep 17 00:00:00 2001 From: nocturn9x Date: Fri, 21 May 2021 11:43:24 +0200 Subject: [PATCH] Minor wording and typos fixes --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 6702a95..bd2e618 100644 --- a/README.md +++ b/README.md @@ -176,8 +176,8 @@ The reason for this is that while giambio tries to separate the async and sync w - It creates this weird coroutine object - Passes that object to `await`, which runs the function -This is due to the fact that people started writing asynchronous Python code _before_ the `async`/`await` syntax was added -so many libraries (like asyncio), had to figure out some clever hacks to make it work without native support from the language +This is due to the fact that people started writing asynchronous Python code _before_ the `async`/`await` syntax was added, +so many libraries (like asyncio) had to figure out some clever hacks to make it work without native support from the language itself, taking advantage of generator functions (we'll talk about those later on), and coroutines are heavily based on generators. @@ -604,7 +604,7 @@ This is where clients will be dispatched once they connect: (or any size in that range) depending on your OS buffers and network congestion - We do a little check here: if what we receive is an empty message, then our client is gone and we can exit the loop - Since I want to show off giambio's exception handling, I added a little if condition that will raise an exception if a client - sends us a message with "exit" as content: this will propagate the task in our `serve` function and kill all children tasks + sends us a message with "exit" as content: this will propagate the exception in our `serve` function and kill all children tasks - Here comes the "echo" part of "echo server": We log the message to the screen and then send the same data back to our client Finally, some startup code: @@ -683,7 +683,7 @@ Save this into a file and try running it, you should see something along the lin ``` Yay! Our echo server is running, let's test it out by using the netcat terminal utility: ``` -user@hostname:~ # nc localhost 1501 +user@hostname:~ # nc localhost 1500 Welcome to the server pal, feel free to send me something! -> async server test Got: async server test