Skip to content

Commit

Permalink
Deploy site
Browse files Browse the repository at this point in the history
  • Loading branch information
Lonami committed Jan 7, 2024
1 parent e7c302a commit 9922780
Show file tree
Hide file tree
Showing 10 changed files with 181 additions and 9 deletions.
4 changes: 2 additions & 2 deletions blog/asyncio/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!doctype html><html lang=en><head><meta charset=utf-8><meta content="Official Lonami's website" name=description><meta content="width=device-width,initial-scale=1.0,user-scalable=yes" name=viewport><title> An Introduction to Asyncio | Lonami's Blog </title><link href=/style.css rel=stylesheet><body><article><nav class=sections><ul class=left><li><a href=/>lonami's site</a><li><a class=selected href=/blog>blog</a><li><a href=/golb>golb</a></ul><div class=right><a href=https://github.com/LonamiWebs><img alt=github src=/img/github.svg></a><a href=/blog/atom.xml><img alt=rss src=/img/rss.svg></a></div></nav><main><h1 class=title>An Introduction to Asyncio</h1><div class=time><p>2018-06-13<p>last updated 2020-10-03</div><h2 id=index>Index</h2><ul><li><a href=https://lonami.dev/blog/asyncio/#background>Background</a><li><a href=https://lonami.dev/blog/asyncio/#input-output>Input / Output</a><li><a href=https://lonami.dev/blog/asyncio/#diving-in>Diving In</a><li><a href=https://lonami.dev/blog/asyncio/#a-toy-example>A Toy Example</a><li><a href=https://lonami.dev/blog/asyncio/#a-real-example>A Real Example</a><li><a href=https://lonami.dev/blog/asyncio/#extra-material>Extra Material</a></ul><h2 id=background>Background</h2><p>After seeing some friends struggle with <code>asyncio</code> I decided that it could be a good idea to write a blog post using my own words to explain how I understand the world of asynchronous IO. I will focus on Python's <code>asyncio</code> module but this post should apply to any other language easily.<p>So what is <code>asyncio</code> and what makes it good? Why don't we just use the old and known threads to run several parts of the code concurrently, at the same time?<p>The first reason is that <code>asyncio</code> makes your code easier to reason about, as opposed to using threads, because the amount of ways in which your code can run grows exponentially. Let's see that with an example. Imagine you have this code:<pre class=language-python data-lang=python><code class=language-python data-lang=python>def method():
<!doctype html><html lang=en><head><meta charset=utf-8><meta content="Official Lonami's website" name=description><meta content="width=device-width,initial-scale=1.0,user-scalable=yes" name=viewport><title> An Introduction to Asyncio | Lonami's Blog </title><link href=/style.css rel=stylesheet><body><article><nav class=sections><ul class=left><li><a href=/>lonami's site</a><li><a class=selected href=/blog>blog</a><li><a href=/golb>golb</a></ul><div class=right><a href=https://github.com/LonamiWebs><img alt=github src=/img/github.svg></a><a href=/blog/atom.xml><img alt=rss src=/img/rss.svg></a></div></nav><main><h1 class=title>An Introduction to Asyncio</h1><div class=time><p>2018-06-13<p>last updated 2023-11-22</div><h2 id=index>Index</h2><ul><li><a href=https://lonami.dev/blog/asyncio/#background>Background</a><li><a href=https://lonami.dev/blog/asyncio/#input-output>Input / Output</a><li><a href=https://lonami.dev/blog/asyncio/#diving-in>Diving In</a><li><a href=https://lonami.dev/blog/asyncio/#a-toy-example>A Toy Example</a><li><a href=https://lonami.dev/blog/asyncio/#a-real-example>A Real Example</a><li><a href=https://lonami.dev/blog/asyncio/#extra-material>Extra Material</a></ul><h2 id=background>Background</h2><p>After seeing some friends struggle with <code>asyncio</code> I decided that it could be a good idea to write a blog post using my own words to explain how I understand the world of asynchronous IO. I will focus on Python's <code>asyncio</code> module but this post should apply to any other language easily.<p>So what is <code>asyncio</code> and what makes it good? Why don't we just use the old and known threads to run several parts of the code concurrently, at the same time?<p>The first reason is that <code>asyncio</code> makes your code easier to reason about, as opposed to using threads, because the amount of ways in which your code can run grows exponentially. Let's see that with an example. Imagine you have this code:<pre class=language-python data-lang=python><code class=language-python data-lang=python>def method():
line 1
line 2
line 3
Expand Down Expand Up @@ -44,7 +44,7 @@
process request
return result

run in parallel (
run concurrently (
method with request 1,
method with request 2,
)
Expand Down
69 changes: 66 additions & 3 deletions blog/atom.xml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion blog/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!doctype html><html lang=en><head><meta charset=utf-8><meta content="Official Lonami's website" name=description><meta content="width=device-width,initial-scale=1.0,user-scalable=yes" name=viewport><title> Lonami's Blog </title><link href=/style.css rel=stylesheet><body><article><nav class=sections><ul class=left><li><a href=/>lonami's site</a><li><a class=selected href=/blog>blog</a><li><a href=/golb>golb</a></ul><div class=right><a href=https://github.com/LonamiWebs><img alt=github src=/img/github.svg></a><a href=/blog/atom.xml><img alt=rss src=/img/rss.svg></a></div></nav><main><h1 class=title>My Blog</h1><p id=welcome onclick=pls_stop()>Welcome to my blog!<p>Here I occasionally post new entries, mostly tech related. Perhaps it's tips for a new game I'm playing, perhaps it has something to do with FFI, or perhaps I'm fighting the borrow checker (just kidding, I'm over that. Mostly).<hr><ul><li><a href=https://lonami.dev/blog/stalebots/>In defense of stale-bots</a><span class=dim> [mod opensource; 'opensource, 'github, 'automation] </span><li><a href=https://lonami.dev/blog/woce-8/>Writing our own Cheat Engine: Multilevel pointers</a><span class=dim> [mod sw; 'windows, 'rust, 'hacking] </span><li><a href=https://lonami.dev/blog/woce-7/>Writing our own Cheat Engine: Code Injection</a><span class=dim> [mod sw; 'windows, 'rust, 'hacking] </span><li><a href=https://lonami.dev/blog/woce-6/>Writing our own Cheat Engine: Pointers</a><span class=dim> [mod sw; 'windows, 'rust, 'hacking] </span><li><a href=https://lonami.dev/blog/woce-5/>Writing our own Cheat Engine: Code finder</a><span class=dim> [mod sw; 'windows, 'rust, 'hacking] </span><li><a href=https://lonami.dev/blog/woce-4/>Writing our own Cheat Engine: Floating points</a><span class=dim> [mod sw; 'windows, 'rust, 'hacking] </span><li><a href=https://lonami.dev/blog/woce-3/>Writing our own Cheat Engine: Unknown initial value</a><span class=dim> [mod sw; 'windows, 'rust, 'hacking] </span><li><a href=https://lonami.dev/blog/woce-2/>Writing our own Cheat Engine: Exact Value scanning</a><span class=dim> [mod sw; 'windows, 'rust, 'hacking] </span><li><a href=https://lonami.dev/blog/woce-1/>Writing our own Cheat Engine: Introduction</a><span class=dim> [mod sw; 'windows, 'rust, 'hacking] </span><li><a href=https://lonami.dev/blog/university/>Data Mining, Warehousing and Information Retrieval</a><span class=dim> [mod algos; 'series, 'bigdata, 'databases] </span><li><a href=https://lonami.dev/blog/new-computer/>My new computer</a><span class=dim> [mod hw; 'showoff] </span><li><a href=https://lonami.dev/blog/tips-outpost/>Tips for Outpost</a><span class=dim> [mod games; 'tips] </span><li><a href=https://lonami.dev/blog/ctypes-and-windows/>Python ctypes and Windows</a><span class=dim> [mod sw; 'python, 'ffi, 'windows] </span><li><a href=https://lonami.dev/blog/pixel-dungeon/>Shattered Pixel Dungeon</a><span class=dim> [mod games; 'tips] </span><li><a href=https://lonami.dev/blog/installing-nixos-2/>Installing NixOS, Take 2</a><span class=dim> [mod sw; 'os, 'nixos] </span><li><a href=https://lonami.dev/blog/breaking-ror/>Breaking Risk of Rain</a><span class=dim> [mod games; 'tips] </span><li><a href=https://lonami.dev/blog/world-edit/>WorldEdit Commands</a><span class=dim> [mod games; 'minecraft, 'worldedit, 'tips] </span><li><a href=https://lonami.dev/blog/asyncio/>An Introduction to Asyncio</a><span class=dim> [mod sw; 'python, 'asyncio] </span><li><a href=https://lonami.dev/blog/posts/>Atemporal Blog Posts</a><span class=dim> [mod algos; 'algorithms, 'culture, 'debate, 'foodforthought, 'graphics, 'optimization] </span><li><a href=https://lonami.dev/blog/graphs/>Graphs</a><span class=dim> [mod algos; 'graphs] </span><li><a href=https://lonami.dev/blog/installing-nixos/>Installing NixOS</a><span class=dim> [mod sw; 'os, 'nixos] </span></ul><script>const WELCOME_EN = 'Welcome to my blog!'
<!doctype html><html lang=en><head><meta charset=utf-8><meta content="Official Lonami's website" name=description><meta content="width=device-width,initial-scale=1.0,user-scalable=yes" name=viewport><title> Lonami's Blog </title><link href=/style.css rel=stylesheet><body><article><nav class=sections><ul class=left><li><a href=/>lonami's site</a><li><a class=selected href=/blog>blog</a><li><a href=/golb>golb</a></ul><div class=right><a href=https://github.com/LonamiWebs><img alt=github src=/img/github.svg></a><a href=/blog/atom.xml><img alt=rss src=/img/rss.svg></a></div></nav><main><h1 class=title>My Blog</h1><p id=welcome onclick=pls_stop()>Welcome to my blog!<p>Here I occasionally post new entries, mostly tech related. Perhaps it's tips for a new game I'm playing, perhaps it has something to do with FFI, or perhaps I'm fighting the borrow checker (just kidding, I'm over that. Mostly).<hr><ul><li><a href=https://lonami.dev/blog/inspecting-tls-traffic/>Downloading Minecraft modpacks without using adware launchers</a><span class=dim> [mod network; 'windows, 'minecraft, 'python, 'tls] </span><li><a href=https://lonami.dev/blog/stalebots/>In defense of stale-bots</a><span class=dim> [mod opensource; 'opensource, 'github, 'automation] </span><li><a href=https://lonami.dev/blog/woce-8/>Writing our own Cheat Engine: Multilevel pointers</a><span class=dim> [mod sw; 'windows, 'rust, 'hacking] </span><li><a href=https://lonami.dev/blog/woce-7/>Writing our own Cheat Engine: Code Injection</a><span class=dim> [mod sw; 'windows, 'rust, 'hacking] </span><li><a href=https://lonami.dev/blog/woce-6/>Writing our own Cheat Engine: Pointers</a><span class=dim> [mod sw; 'windows, 'rust, 'hacking] </span><li><a href=https://lonami.dev/blog/woce-5/>Writing our own Cheat Engine: Code finder</a><span class=dim> [mod sw; 'windows, 'rust, 'hacking] </span><li><a href=https://lonami.dev/blog/woce-4/>Writing our own Cheat Engine: Floating points</a><span class=dim> [mod sw; 'windows, 'rust, 'hacking] </span><li><a href=https://lonami.dev/blog/woce-3/>Writing our own Cheat Engine: Unknown initial value</a><span class=dim> [mod sw; 'windows, 'rust, 'hacking] </span><li><a href=https://lonami.dev/blog/woce-2/>Writing our own Cheat Engine: Exact Value scanning</a><span class=dim> [mod sw; 'windows, 'rust, 'hacking] </span><li><a href=https://lonami.dev/blog/woce-1/>Writing our own Cheat Engine: Introduction</a><span class=dim> [mod sw; 'windows, 'rust, 'hacking] </span><li><a href=https://lonami.dev/blog/university/>Data Mining, Warehousing and Information Retrieval</a><span class=dim> [mod algos; 'series, 'bigdata, 'databases] </span><li><a href=https://lonami.dev/blog/new-computer/>My new computer</a><span class=dim> [mod hw; 'showoff] </span><li><a href=https://lonami.dev/blog/tips-outpost/>Tips for Outpost</a><span class=dim> [mod games; 'tips] </span><li><a href=https://lonami.dev/blog/ctypes-and-windows/>Python ctypes and Windows</a><span class=dim> [mod sw; 'python, 'ffi, 'windows] </span><li><a href=https://lonami.dev/blog/pixel-dungeon/>Shattered Pixel Dungeon</a><span class=dim> [mod games; 'tips] </span><li><a href=https://lonami.dev/blog/installing-nixos-2/>Installing NixOS, Take 2</a><span class=dim> [mod sw; 'os, 'nixos] </span><li><a href=https://lonami.dev/blog/breaking-ror/>Breaking Risk of Rain</a><span class=dim> [mod games; 'tips] </span><li><a href=https://lonami.dev/blog/world-edit/>WorldEdit Commands</a><span class=dim> [mod games; 'minecraft, 'worldedit, 'tips] </span><li><a href=https://lonami.dev/blog/asyncio/>An Introduction to Asyncio</a><span class=dim> [mod sw; 'python, 'asyncio] </span><li><a href=https://lonami.dev/blog/posts/>Atemporal Blog Posts</a><span class=dim> [mod algos; 'algorithms, 'culture, 'debate, 'foodforthought, 'graphics, 'optimization] </span><li><a href=https://lonami.dev/blog/graphs/>Graphs</a><span class=dim> [mod algos; 'graphs] </span><li><a href=https://lonami.dev/blog/installing-nixos/>Installing NixOS</a><span class=dim> [mod sw; 'os, 'nixos] </span></ul><script>const WELCOME_EN = 'Welcome to my blog!'
const WELCOME_ES = '¡Bienvenido a mi blog!'
const APOLOGIES = "ok sorry i'll stop"
const REWRITE_DELAY = 5000
Expand Down
Loading

0 comments on commit 9922780

Please sign in to comment.