<?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>Sockets on Inverted Tree</title>
    <link>https://inverted-tree.pages.dev/tags/sockets/</link>
    <description>Recent content in Sockets on Inverted Tree</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Tue, 15 Apr 2025 18:30:00 +0000</lastBuildDate>
    <atom:link href="https://inverted-tree.pages.dev/tags/sockets/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Using django channels to build real time applications</title>
      <link>https://inverted-tree.pages.dev/posts/using-django-channels-to-build-real-time-applications/</link>
      <pubDate>Tue, 15 Apr 2025 18:30:00 +0000</pubDate>
      <guid>https://inverted-tree.pages.dev/posts/using-django-channels-to-build-real-time-applications/</guid>
      <description>&lt;h2 id=&#34;table-of-contents&#34;&gt;Table of Contents&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;#introduction&#34;&gt;Introduction&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#main-concepts&#34;&gt;Main Concepts&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;#asgi&#34;&gt;asgi&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#websockets&#34;&gt;Websockets&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#channel&#34;&gt;Channel&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#implementation&#34;&gt;Implementation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#chat&#34;&gt;Chat&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#testing&#34;&gt;Testing&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#final-thoughts&#34;&gt;Final Thoughts&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This tutorial is for django developers who are comfortable with the primitives and want to build real time applications using django + channels. We&amp;rsquo;ll be building a minimal intercom clone(backend only) to simulate chat support provided to client websites who embed our widget for website visitors as illustrated&lt;/p&gt;
&lt;p&gt;&lt;img alt=&#34;Schematic of channels-chat&#34; loading=&#34;lazy&#34; src=&#34;https://pub-610e38254acb47cea52a77d9d4b58499.r2.dev/blog/d4e16965-18.webp&#34;&gt;&lt;/p&gt;
&lt;h3 id=&#34;introduction&#34;&gt;Introduction&lt;/h3&gt;
&lt;p&gt;Real time systems differ from traditional systems by the constraint of response time - typically they need to respond to changes in state immediately or within a guaranteed time frame, often dictated by the system&amp;rsquo;s operation requirements. Unlike traditional request-response systems, real time systems prioritise timely and predictable execution, often at the expense of throughput or flexibility. For ex in a ticket booking website like Ticketmaster, the typical request-response flow comprises of fetching all the available tickets for the user&amp;rsquo;s search criteria, booking them etc, all of which can tolerate brief delays. Contrast it with a real time system like a trading app where trades have to be executed immediately as soon as a request is made and execution time is a governing factor in the quality and success of this service.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
