Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yet another extra credit opportunity #550

Open
mikeizbicki opened this issue May 3, 2023 · 6 comments
Open

Yet another extra credit opportunity #550

mikeizbicki opened this issue May 3, 2023 · 6 comments

Comments

@mikeizbicki
Copy link
Owner

There's a good presentation by spotify about how they use python async functions to improve their backend performance. (The final wardial assignment is about async functions, and this is a good realworld example of using them in the wild.)

You can find the video at https://www.youtube.com/watch?v=bckD_GK80oY&lc=Ugw9rZpVVSqT9WrCBEJ4AaABAg and a writeup at https://www.roguelynn.com/words/asyncio-we-did-it-wrong/.

If you read the writeup, watch the video, and reply to this issue with 3 things you learned, I'll give you 1 point of extra credit on your async/wardial assignment.

@mikeizbicki mikeizbicki changed the title Another extra credit opportunity Yet another extra credit opportunity May 3, 2023
@FallynB
Copy link

FallynB commented May 12, 2023

Hi! I found both of these to be informative, but the quality of the article was better in my opinion.

I learned the following:

  1. I learned that asyncio or asynchronous programming is when a programmer is allowed to run multiple applications in the background without needing to wait or have each function called be dependant on one another. I was not familiar with this too much before.

  2. The article gave me some insight on what the flaws of this programming type were. Its limited use provided a fallacy for the users who were initially excited to use the model with all of its' presumed power. They describe it was only being able to provide impact on the same level as "Hello World." I did some additional research on when this type of programming should be used over alternative methods. Many stated that this could be overused and used incorrectly, so more knowledge on object oriented programming could be beneficial if I wish to familiarise myself with this.

  3. The YouTube video also offered some insight on how debugging should be handled in async programming. I learned that debugging is especially important when using async programming. This is because if the code is poorly written, it will prohibit all the functions that rely on it from running properly. This can create additional errors and confusion. Writing the code well initially prevents this from being the case.

@luisgomez214
Copy link

  1. I learned what asynchronous programming was. Though I was familiar with the definition, it was informative learning the benefits of asynchronous programming. Knowing why programmers use it allows me to have a better understanding of the potential uses.

  2. The video helped me visualize how asynchronous programming is used. The presenter provided a walkthrough that was informative. It was helpful seeing the writing process and thought process that goes behind using asynchronous programming.

  3. The article was helpful in teaching concepts and the fundemantlas of async programming. It reminded me of the tutorials we would sometimes have in lab. It was an interactive and encouraged readers to follow along. The explanations after every chunk of code helped explain what everything was doing and the inventions behind it.

@GusAlbach
Copy link

  1. I learned what being threadsafe is in programming, and what a thread is to begin with. I had never heard of a thread before in any programming class, but the quality of threadsafe does seem important to allow multiple threads to access the same information.
  2. I discovered that, like most tools, asyncio is only particularly beneficial when used properly. Lynn Root, and a few people in the comments pointed out that often simply throwing the asyncio keywords where you think they ought to go could lead to thinking something is running async, when it is instead serial.
  3. I learned that attempting to perform a shutdown of the program is difficult. Lynn had to build a signal handler rather than using a simple keyboardinterrupt. This was successful in performing a graceful shutdown (particularly allowing current processes to finish, or choosing if pending ones should finish or not). The attempt to use shield to further the shutdown ability seemed to further contemplate the process, as Lynn admitted she hadn't figured out how to get it to work.

@nliyanage
Copy link

here are three things i learned:

1 - many asyncio tutorials can appear approachable for learning in-depth and real-world examples, but in reality, are very simple (they just end up printing hello world), or only ends up providing guidance for a portion of a useful solution.
2 - asyncio can be easily misused, and very complex-looking programs can end up just being web crawlers
3 - when debugging asynchronous programs, there are many ways to debug, including print statements, using source_traceback, and doing other things in debug mode

overall, i found the video and article a bit confusing and difficult to follow, as a lot of the concepts that were referenced had some background knowledge required that i don't have/fully understand

@finnless
Copy link
Contributor

  1. Although I have done some multiprocessing work in python before, I had very little experience or understanding of how threading works in python with asyncio. These materials gave me a much better understand of what is going on behind the scenes.
  2. The talk did a good job of cautioning developers about the dangers of thinking that asynchronous programing is easy. Although asyncio is a great tool and easy to use, that also can lead to overconfidence in one's understanding of whats really going on. Like root says, "asynchronous programming is difficult." This advice will be helpful for me when doing my own asynchronous programming in the future.
  3. I learned that in some cases using await still blocks things within the current scope and that asyncio.create_task will schedule a task without blocking things that come after. Accidentally blocking while in some kind of loop may result in the program running serially even though asyncio is being used and the program is working.

@buffeinstein
Copy link
Contributor

I learned these three things:

  1. I learned that debugging asynchronous code can use Async IO's debug mode. Tools like cProfile and pyprof2calltree can identify performance bottlenecks, slow tasks, and unhandled exceptions.

  2. The video demonstrated effective strategies for testing asynchronous code using tools like pytest and asyncio_test. It showed how to create mock co-routines, manipulate event loops, and manage asynchronous tasks to create comprehensive and reliable testing of async functions.

  3. I learned the importance of graceful shutdown mechanisms in async services. The video highlighted the importance of handling signals and exceptions properly during shutdown, making sure that resources are cleaned up and tasks are terminated correctly, thus maintaining the stability and reliability of the application.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants