SShortSingh.
Back to feed

Kotlin Coroutines Channels and Backpressure for a Resilient Event Bus

0
·5 views

A tutorial walks through building a typed event bus in Kotlin using coroutines, aimed at fan-out dispatch to multiple subscribers. It compares the four channel capacity modes (rendezvous, buffered, unlimited, conflated) and warns that unlimited channels risk out-of-memory failures under sustained load. It recommends SharedFlow with a suspending overflow policy as the event bus foundation, since silently dropping events is a data integrity concern. To stop one slow subscriber from stalling others, each subscriber gets its own local channel fed via non-suspending sends, with supervisorScope isolating failures. Finally, it proposes a simple formula relating peak emission rate and consumer processing time to required buffer depth.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Developer Builds Reusable Time-Travel History Engine for Games and Banking Apps with Kiro

A 19-year-old engineering sophomore created The Sands of Time, an open-source C#/.NET history engine, after a lost Valorant match inspired the idea of revisiting past decisions. The engine records an application's history, restores precise past states, and lets developers explore alternative decisions while preserving the original timeline. It is designed as a domain-agnostic component, so it can serve games, banking, logistics, or manufacturing alike. The project was built as part of an entry to the Kiroween 2026 hackathon, Skeleton Crew category, with Kiro used to help make the foundation easier to adopt and verify. The author frames the engine as a reusable foundation that handles recording, reconstruction, branching, and verification while each application supplies its own state and rules.

0
ProgrammingDEV Community ·

Fortinet NSE 6 FortiRecon 26 Analyst Exam: Format, Domains and Preparation Guide

The Fortinet NSE 6 FortiRecon 26 Analyst exam (NSE6_FRC_AN-26) is a 60-minute, pass-or-fail proctored test with 30 to 40 questions across four domains. Its largest section covers FortiRecon deployment, followed by core module analysis, intelligence reports, and security orchestration with APIs. Fortinet advises at least six months of hands-on FortiRecon experience and most questions present analysts with a finding and ask for the next step. The article walks through a sample attack-surface finding and offers a Python script that converts a FortiRecon export into a triage queue. Exam details such as passing score and price are not published, and the attached domain weightings are the author's own estimates rather than official figures.

0
ProgrammingDEV Community ·

How to test voice AI agents before and after launch

Voice agent testing combines pre-launch simulated calls with post-launch monitoring of real conversations. Before release, simulated callers with varied accents, background noise and interruption habits run scripted scenarios, measuring latency, task completion, tool use and escalation. After launch, real production calls are reviewed to catch failures no one anticipated, and each one is converted into a new test case. Voice introduces problems text agents lack, such as speech recognition errors, delays that feel like dead air, and callers talking over the agent. Most teams therefore need one kind of tool for simulation and another for production monitoring. The source article is written by a vendor, Agnost AI, which is disclosed.

0
ProgrammingDEV Community ·

Guide to Parsing and Checking MusicXML Scores with Python's Standard Library

A developer explains how optical music recognition can turn photos or PDFs of printed sheet music into editable scores, and offers an alternative for users who prefer a web tool. The post then shows how to read MusicXML files with about 120 lines of standard-library Python, using the first page of Mozart's String Quartet K.80 as an example. It covers pitch conversion to MIDI numbers, clef and range checks, and beat counting to catch recognition errors. The author also describes how to transpose a score by adding semitones and adjusting the key signature's fifths value.