Using django channels to build real time applications

Table of Contents Introduction Main Concepts asgi Websockets Channel Implementation Chat Testing Final Thoughts This tutorial is for django developers who are comfortable with the primitives and want to build real time applications using django + channels. We’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 Introduction 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’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’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. ...

April 15, 2025 · 13 min · Navdeep Saini

Learning haskell and yaml by building a yaml parser

I’ve been learning haskell for some time now and it has been amazing grappling with pure functional programming concepts. Although it’s not for everyone, I believe its potential is too much in terms purity. The best way for me to learn anything is to just build something and i’m quite infatuated with yaml right now, so I suppose i’ll build a very basic yaml parser to learn about parsing concepts and how haskell helps with its functional prowess. Since the markup language has just data and no instructions, it’s suited for a recursive data definition which Haskell excels in, among other things. ...

October 7, 2024 · 5 min · Navdeep Saini