DEV Community

Cover image for Phase 0 (Week 2): Let the journey continue
Michael
Michael

Posted on

Phase 0 (Week 2): Let the journey continue

Here we go again.

This week's project took some extra time to actually complete (at least to the point where I feel it's good to move on). I'll divide my thoughts into three sections; it will be easier for me to organise.

Agentic AI and workflow automation (AWA)

Finally, I completed the prerequisites with week 2. Now I can move on to the actually interesting parts. For the past 2 weeks, I focused only on the fundamentals that I'll use later, which are important if I want to make things easier for myself. You can't expect to understand everything at the same time if you don't know the technical terms and aren't aware of the basic requirements.

It's like ordering an egg omelette without eggs. We can't make an egg omelette without eggs, y'know :(

Long story

I went through a lot of docs to learn Python. Since I had a strong background in programming languages, it wasn't that hard (it was, though!). I went through hell learning comprehensions, lists, generators, context managers, decorators, data classes, tuples, dictionaries, and some other nifty things in the first week.

Then I moved on to week 2 and studied the asyncio module, from coroutines, tasks, timeouts, the event loop, and semaphores to cancelling tasks when they come across SIGINTs or timeouts, and other nifty things responsible for retries, backoffs, rate limiting requests, and many more. Honestly, I enjoyed learning them. BUT sometimes I get really bored and just try to push myself (it kind of reminds me of my days doing school assignments).

There were also times when I asked "why?" a lot. Like when I worked on this week's project, which is basically just a resilient fetcher implemented with timeouts, retries, and jitter backoffs. I questioned which status codes should get retries and how to limit the number of requests, and decided to use semaphores.

Interestingly, I used the semaphore class from threading instead of asyncio, which, as you would expect, blocked my whole event loop. And I was like, "Why? How come my program is just hanging without showing any output after all the available resources (semaphore) were taken?"

It took me like 10 minutes just to understand that these guys block my whole event loop without releasing their resources (I used await in the retry loop, so now the control is at the last task that is waiting for the previous tasks to release resources, selfishly hanging without giving it back).

There were a lot of such situations throughout the buildup (it would take too much time to explain them), and I can still see a lot more happening.

OSTEP

This is my solace in this hard world (jk). I like reading this book way too much. My professor (self-proclaimed) explains things in a way that makes me think, think, think. I take time to digest each topic. Recently, I reached memory virtualisation, which is, let me tell you, really confusing sometimes. It's not the explanation; it is the best. We'll talk about it when I complete my virtualisation piece before throwing my questions that i question whether they are really questions (I dont have schizophrenia!!).

Top comments (0)