<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Rainux</title>
    <link>https://gh.heruos.top/en/</link>
    <description>Recent content on Rainux</description>
    <generator>Hugo -- 0.152.2</generator>
    <language>en</language>
    <lastBuildDate>Sat, 14 Feb 2026 12:40:31 +0800</lastBuildDate>
    <atom:link href="https://gh.heruos.top/en/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Flask - Common Application Deployment Solutions</title>
      <link>https://gh.heruos.top/en/post/2026/flask-common-deploy-methods/</link>
      <pubDate>Sat, 14 Feb 2026 12:40:31 +0800</pubDate>
      <guid>https://gh.heruos.top/en/post/2026/flask-common-deploy-methods/</guid>
      <description>This article introduces several common deployment solutions for Flask applications in production environments</description>
    </item>
    <item>
      <title>Executing Asynchronous Scheduled Tasks with Database-Based Distributed Locking in FastAPI</title>
      <link>https://gh.heruos.top/en/post/2026/fastapi-schedule-async-job-with-db-lock/</link>
      <pubDate>Sun, 08 Feb 2026 23:56:57 +0800</pubDate>
      <guid>https://gh.heruos.top/en/post/2026/fastapi-schedule-async-job-with-db-lock/</guid>
      <description>This article provides a comprehensive guide on implementing an asynchronous task scheduler in FastAPI, using database-based distributed locks to prevent duplicate task execution in multi-process environments.</description>
    </item>
    <item>
      <title>Using UPSERT in SQLAlchemy</title>
      <link>https://gh.heruos.top/en/post/2026/sqlalchemy-upsert/</link>
      <pubDate>Sun, 08 Feb 2026 16:20:18 +0800</pubDate>
      <guid>https://gh.heruos.top/en/post/2026/sqlalchemy-upsert/</guid>
      <description>This article explains how to use UPSERT operations in SQLAlchemy with PostgreSQL and SQLite</description>
    </item>
    <item>
      <title>Exploring the Official MCP Go SDK</title>
      <link>https://gh.heruos.top/en/post/2026/exploring-the-official-mcp-go-sdk/</link>
      <pubDate>Sat, 07 Feb 2026 15:05:31 +0800</pubDate>
      <guid>https://gh.heruos.top/en/post/2026/exploring-the-official-mcp-go-sdk/</guid>
      <description>Hands-on experience with the official MCP Go SDK: Building an MCP Server and an MCP Client that enables LLMs to autonomously select tools</description>
    </item>
    <item>
      <title>Deploying a Single-Node Kubernetes Cluster on Debian 13 with kubeadm and Cilium</title>
      <link>https://gh.heruos.top/en/post/2026/deb13-kubernetes-cilium/</link>
      <pubDate>Thu, 05 Feb 2026 00:44:06 +0800</pubDate>
      <guid>https://gh.heruos.top/en/post/2026/deb13-kubernetes-cilium/</guid>
      <description>This article provides a comprehensive guide on deploying a single-node Kubernetes cluster in a local virtual machine environment using Cilium as the network plugin.</description>
    </item>
    <item>
      <title>Flask - Design and Implementation of tracking_id</title>
      <link>https://gh.heruos.top/en/post/2026/01-17-flask_tracking_id_design/</link>
      <pubDate>Sat, 17 Jan 2026 17:36:52 +0800</pubDate>
      <guid>https://gh.heruos.top/en/post/2026/01-17-flask_tracking_id_design/</guid>
      <description>This article details how to implement request tracking ID (tracking_id) functionality in Flask applications, including middleware design, logging, response formatting, and a complete solution to help developers achieve request tracing and enhance system observability.</description>
    </item>
    <item>
      <title>FastAPI - Calling Synchronous Methods in FastAPI Asynchronous Methods</title>
      <link>https://gh.heruos.top/en/post/2026/01-06-fastapi_calling_sync_method_in_async_method/</link>
      <pubDate>Tue, 06 Jan 2026 16:19:44 +0800</pubDate>
      <guid>https://gh.heruos.top/en/post/2026/01-06-fastapi_calling_sync_method_in_async_method/</guid>
      <description>&lt;h2 id=&#34;introduction&#34;&gt;Introduction&lt;/h2&gt;
&lt;p&gt;Directly calling synchronous methods within asynchronous methods blocks the entire event loop, preventing the application from handling any other concurrent requests while executing the synchronous method. This severely impacts the overall performance and responsiveness of the service.&lt;/p&gt;
&lt;p&gt;To address this issue, the core approach is to delegate synchronous methods to external thread pools or process pools for execution, thereby avoiding blocking the main event loop.&lt;/p&gt;
&lt;h2 id=&#34;method-1-using-asyncioto_thread&#34;&gt;Method 1: Using asyncio.to_thread&lt;/h2&gt;
&lt;p&gt;Python 3.9 and later versions provide the &lt;code&gt;asyncio.to_thread&lt;/code&gt; method, which runs synchronous functions in a separate thread and returns a coroutine object that can be awaited.&lt;/p&gt;</description>
    </item>
    <item>
      <title>MCP-01: Introduction and Core Concepts</title>
      <link>https://gh.heruos.top/en/post/2025/mcp-01/</link>
      <pubDate>Thu, 25 Dec 2025 00:14:28 +0800</pubDate>
      <guid>https://gh.heruos.top/en/post/2025/mcp-01/</guid>
      <description>Introduction to MCP (Model Context Protocol)</description>
    </item>
    <item>
      <title>About</title>
      <link>https://gh.heruos.top/en/about/</link>
      <pubDate>Wed, 24 Dec 2025 23:47:24 +0800</pubDate>
      <guid>https://gh.heruos.top/en/about/</guid>
      <description>&lt;p&gt;Rainux He &amp;lt;&amp;ndash;&amp;gt; 花酒锄作田, a normal developer, mainly develop Golang and Python program, familiar with cloud native development based on Kubernetes, have a little experience with web development (Vue).&lt;/p&gt;
&lt;hr&gt;
&lt;ul&gt;
&lt;li&gt;Email: &lt;a href=&#34;mailto:heruos@qq.com&#34;&gt;heruos@qq.com&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://heruos.top&#34;&gt;https://heruos.top&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://gh.heruos.top&#34;&gt;https://gh.heruos.top&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://rainux.cn&#34;&gt;https://rainux.cn&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://wiki.rainux.cn&#34;&gt;https://wiki.rainux.cn&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description>
    </item>
    <item>
      <title>FastAPI - Design of tracking_id</title>
      <link>https://gh.heruos.top/en/post/2025/fastapi_design_of_tracking_id/</link>
      <pubDate>Thu, 11 Dec 2025 00:40:44 +0800</pubDate>
      <guid>https://gh.heruos.top/en/post/2025/fastapi_design_of_tracking_id/</guid>
      <description>&lt;h2 id=&#34;introduction&#34;&gt;Introduction&lt;/h2&gt;
&lt;p&gt;In real business scenarios, tracing a request&amp;rsquo;s complete processing path in logs based on a &lt;code&gt;tracking_id&lt;/code&gt; is a common requirement. However, FastAPI does not provide this functionality out of the box, so developers need to implement it themselves. This article introduces how to add a tracking_id to the entire request lifecycle based on &lt;code&gt;contextvars&lt;/code&gt; and automatically record it in logs.&lt;/p&gt;
&lt;h2 id=&#34;what-is-contextvars&#34;&gt;What is contextvars&lt;/h2&gt;
&lt;p&gt;Python 3.7 added a module &lt;code&gt;contextvars&lt;/code&gt; to the standard library, which stands for &amp;ldquo;Context Variables&amp;rdquo;. It is typically used to implicitly pass some environmental information variables, similar to &lt;code&gt;threading.local()&lt;/code&gt;. However, &lt;code&gt;threading.local()&lt;/code&gt; is thread-specific, isolating data states between threads, while &lt;code&gt;contextvars&lt;/code&gt; can be used in asynchronous coroutines within the &lt;code&gt;asyncio&lt;/code&gt; ecosystem. &lt;strong&gt;PS: &lt;code&gt;contextvars&lt;/code&gt; can not only be used in asynchronous coroutines but can also replace &lt;code&gt;threading.local()&lt;/code&gt; in multi-threaded functions.&lt;/strong&gt;&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
