publish blog
This commit is contained in:
parent
cad3df3824
commit
83fe8acf7e
@ -5,6 +5,8 @@ tags: ["programming", "python"]
|
|||||||
draft: false
|
draft: false
|
||||||
---
|
---
|
||||||
|
|
||||||
|
> This post was written while I was working for [Memfault](https://memfault.com) and re-posted with permission here. The original post is [on Memfault's blog](https://memfault.com/blog/a-useful-sqlalchemy-psycopg2-trick-non-blocking-mode/).
|
||||||
|
|
||||||
We discovered a handy trick to make SQLAlchemy – or rather the underlying PostgreSQL driver called `psycopg2` – behave nicer in our Python-based backend service, by not tying up the Python process while waiting for a PostgreSQL query to finish. The improvements are especially evident in long-running queries but they also improve general system responsiveness.
|
We discovered a handy trick to make SQLAlchemy – or rather the underlying PostgreSQL driver called `psycopg2` – behave nicer in our Python-based backend service, by not tying up the Python process while waiting for a PostgreSQL query to finish. The improvements are especially evident in long-running queries but they also improve general system responsiveness.
|
||||||
|
|
||||||
## The problem – blocking the Python runtime
|
## The problem – blocking the Python runtime
|
||||||
|
|||||||
@ -1,42 +0,0 @@
|
|||||||
---
|
|
||||||
title: "If by Rudyard Kipling"
|
|
||||||
date: 2024-10-02T12:14:57+03:00
|
|
||||||
tags: ["poetry"]
|
|
||||||
draft: false
|
|
||||||
---
|
|
||||||
|
|
||||||
If you can keep your head when all about you
|
|
||||||
Are losing theirs and blaming it on you,
|
|
||||||
If you can trust yourself when all men doubt you,
|
|
||||||
But make allowance for their doubting too;
|
|
||||||
If you can wait and not be tired by waiting,
|
|
||||||
Or being lied about, don't deal in lies,
|
|
||||||
Or being hated, don't give way to hating,
|
|
||||||
And yet don't look too good, nor talk too wise:
|
|
||||||
|
|
||||||
If you can dream—and not make dreams your master;
|
|
||||||
If you can think—and not make thoughts your aim;
|
|
||||||
If you can meet with Triumph and Disaster
|
|
||||||
And treat those two impostors just the same;
|
|
||||||
If you can bear to hear the truth you've spoken
|
|
||||||
Twisted by knaves to make a trap for fools,
|
|
||||||
Or watch the things you gave your life to, broken,
|
|
||||||
And stoop and build 'em up with worn-out tools:
|
|
||||||
|
|
||||||
If you can make one heap of all your winnings
|
|
||||||
And risk it on one turn of pitch-and-toss,
|
|
||||||
And lose, and start again at your beginnings
|
|
||||||
And never breathe a word about your loss;
|
|
||||||
If you can force your heart and nerve and sinew
|
|
||||||
To serve your turn long after they are gone,
|
|
||||||
And so hold on when there is nothing in you
|
|
||||||
Except the Will which says to them: ‘Hold on!'
|
|
||||||
|
|
||||||
If you can talk with crowds and keep your virtue,
|
|
||||||
Or walk with Kings—nor lose the common touch,
|
|
||||||
If neither foes nor loving friends can hurt you,
|
|
||||||
If all men count with you, but none too much;
|
|
||||||
If you can fill the unforgiving minute
|
|
||||||
With sixty seconds' worth of distance run,
|
|
||||||
Yours is the Earth and everything that's in it,
|
|
||||||
And—which is more—you'll be a Man, my son!
|
|
||||||
@ -60,9 +60,9 @@
|
|||||||
<li><a href="/cv">
|
<li><a href="/cv">
|
||||||
<h5>CV</h5>
|
<h5>CV</h5>
|
||||||
</a></li>
|
</a></li>
|
||||||
<!-- <li><a href="/blog">
|
<li><a href="/blog">
|
||||||
<h5>Blog</h5>
|
<h5>Blog</h5>
|
||||||
</a></li> -->
|
</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
</header>
|
</header>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user