<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ani K</title>
    <description>The latest articles on DEV Community by Ani K (@ani_k_43243167a645bab1b57).</description>
    <link>https://dev.to/ani_k_43243167a645bab1b57</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3660799%2F7d650160-f4dc-427e-9f0a-65baba52f686.jpg</url>
      <title>DEV Community: Ani K</title>
      <link>https://dev.to/ani_k_43243167a645bab1b57</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ani_k_43243167a645bab1b57"/>
    <language>en</language>
    <item>
      <title>🚀 The Timeout Tamer: When Patience Met Progress</title>
      <dc:creator>Ani K</dc:creator>
      <pubDate>Sun, 14 Dec 2025 05:24:13 +0000</pubDate>
      <link>https://dev.to/ani_k_43243167a645bab1b57/the-timeout-tamer-when-patience-met-progress-4ec2</link>
      <guid>https://dev.to/ani_k_43243167a645bab1b57/the-timeout-tamer-when-patience-met-progress-4ec2</guid>
      <description>&lt;p&gt;Imagine hitting a publish on a web page which contains grid like data updates made by users and submit the data and bang api gateway slams the door with timeout, But innovation doesn't wait. &lt;/p&gt;

&lt;p&gt;The Dreaded Impasse&lt;/p&gt;

&lt;p&gt;In the land of Gridopia, Luna the Sorceress prepared her greatest spell — publishing 427 rows of enchanted data. She waved her wand (clicked “Publish”)… and TimeOut, the grumpy gatekeeper, slammed the portal.&lt;br&gt;
“Your patience has expired.”&lt;br&gt;
Had her creation vanished?&lt;br&gt;
The Villain: TimeOut&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;TimeOut:&lt;/em&gt; The ruthless guardian of the 30-second rule. “No lingering. Move or vanish.”
The Heroes Assemble
Luna called upon three brave characters:&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;&lt;em&gt;@TrackProgress (the Narrator)&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;A magical annotation. “I’ll tell the tale of this journey.”&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Async (the Swift Runner)&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;“I’ll offload the heavy lifting. No blocking!”&lt;/li&gt;
&lt;li&gt;&lt;em&gt;SSE (the Whisperer)&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;“I’ll pulse updates in real time. Trust me.”
The Quest: Taming the Timeout
Act 1: The Impasse&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Problem:&lt;/em&gt; The synchronous march to publish 427 rows took too long. TimeOut growled.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Consequence:&lt;/em&gt; Luna was stuck, unsure, lost in limbo.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Act 2: The Async Rescue&lt;br&gt;
Here’s how the heroes joined forces:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Step-by-Step Technical Guide&lt;/em&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;em&gt;@TrackProgress steps in (AOP Magic)&lt;/em&gt;
@TrackProgress("Unleashing the grid gods")
public void publishGrid(List rows) {
String taskId = generateTaskId();
progressService.startTask(taskId, rows.size());
publisher.publishAsync(rows, taskId);
return taskId;
}&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;@TrackProgress (the Narrator):&lt;/em&gt; Marks the epic task. Gives it a heartbeat.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;Async takes the load (Parallel Freedom)&lt;/em&gt;&lt;br&gt;
new Thread(() -&amp;gt; {&lt;br&gt;
try {&lt;br&gt;
// Process in chunks. No rush!&lt;br&gt;
jp.proceed();&lt;br&gt;
completeTask(id);&lt;br&gt;
} catch (Exception e) {&lt;br&gt;
failTask(id, e);&lt;br&gt;
}&lt;br&gt;
}).start();&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;Async (the Swift Runner):&lt;/em&gt; Fires the task. Luna gets:&lt;br&gt;
{&lt;br&gt;
"taskId": "grid-427-groove",&lt;br&gt;
"message": "Your magic is brewing!",&lt;br&gt;
"track": "/pulse"&lt;br&gt;
}&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;SSE whispers the odyssey (Real-Time Bonds)&lt;/em&gt;&lt;br&gt;
// As chunks complete:&lt;br&gt;
progressService.updateProgress(taskId, 42, "Validating dreams…");&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;SSE (the Whisperer):&lt;/em&gt; Streams each heartbeat:&lt;br&gt;
Publishing… 42% [████████▒▒▒]&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The Climax: Progress Conquers Time&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;TimeOut tries to sneer.&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;@TrackProgress narrates milestones.&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Async works in the shadows.&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;SSE keeps Luna hooked.&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The final roar:&lt;br&gt;
Publishing… 100% [████████████] Published! ✨&lt;/p&gt;

&lt;p&gt;Luna smiles. The grid lives.&lt;br&gt;
Cast of Characters &amp;amp; Concepts&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;em&gt;@TrackProgress (the Narrator):&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Annotation + AOP.&lt;/em&gt; Contextualizes the long journey.&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Async (the Swift Runner):&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Java threading, non-blocking.&lt;/em&gt; Follows the path so Luna isn’t stuck.&lt;/li&gt;
&lt;li&gt;&lt;em&gt;SSE (the Whisperer) / Websocket ( the Conductor) :&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Server-Sent Events.&lt;/em&gt; Binds the backend pulse to the frontend heartbeat.&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The websocket orchestres the symphonies.&lt;br&gt;
Note : Use any one based on your architecture constraints&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;TimeOut (the Villain):&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;AWS API Gateway constraint.&lt;/em&gt; The impetus for innovation.&lt;br&gt;
Summary&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;Problem:&lt;/em&gt; Synchronous heaviness hit a hard wall.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;Solution:&lt;/em&gt; Async + &lt;code&gt;@TrackProgress&lt;/code&gt; turned waiting into a progress party.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;Result:&lt;/em&gt; Instead of darkness, a symphony.&lt;br&gt;
The Timeout Tamer’s Creed&lt;br&gt;
Constraints hide gifts. When patience is tested:&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Narrate the effort.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Liberate the process.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Whisper wins in real time.&lt;br&gt;
And TimeOut? It nods in respect.&lt;br&gt;
&lt;em&gt;Takeaway:&lt;/em&gt; Next time limits loom, deploy the trio:&lt;br&gt;
@TrackProgress ➕ Async ➕ SSE/Websocket &lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;How would you have tackled this situation ?&lt;/p&gt;

</description>
      <category>softwaredevelopment</category>
      <category>apioptimization</category>
      <category>java</category>
      <category>springboot</category>
    </item>
  </channel>
</rss>
