Magnus Mårtensson
Microsoft Regional Director, Azure MVP, CEO Loftysoft
Avirag Jain
Director & CTO R Systems
Mahesh Chand
Founder C# Corner, CEO Mindcracker
Chris Gali
CEO & Co-Founder Graphite
Subinder Khurana
Chief Architect StoryProcess, Founder NASSCOM DeepTech Club
Bryan Rishforth
Investor, Chairman Graphite
Bryn Everson
Director Biz Dev Graphite
Raj Tiwari
Digital Transformation Leader, Futurist and Visionary
Joseph Guadagno
Microsoft MVP, Lead Quicken Loans
Nikita Sachdev
Entrepreneur, Blockchain Enthusiast & Advisor, Social Media Influencer
Doug Wagner
COO & Founder Adapt Technical Group
Ritesh Modi
Architect, Senior Evangelist, Cloud Architect
Crystal Wenrick
Director Communications Mindcracker
Allen O’Neill
Microsoft MVP, Consulting Engineer/Architect
Praveen Kumar
CEO MCN Solutions
Chris Love
Founder Love2Dev, Microsoft MVP, Author
Sanjay Vyas
Microsoft Regional Director, Microsoft MVP, Founder & CEO SkillLabs Technologies
Veena Sarda
Deep Learning Consultant, Author
Sekhar Srinivasan
C# Corner MVP, Microsoft Certified Trainer, Pluralsight Author
Lalit Bansal
Founder & CEO - EIY SYS
Navdeep Garg
CEO Revinfotech
Prakash Tripathi
Tech Manager/Leader, Microsoft MVP, Blogger
Bhavna Jain
Breakthrough Consultant
Naveen Sharma
Enterprise Architect, Leadership Coach, Author
Vidya Vrat Agarwal
Principal Architect, Microsoft MVP, Author
Sheetal Agarwal
Founder Clownselors, Medical Clown, Trainer
Abhishek Kant
Founder GTM Catalyst
Vishnu Saran
Founder & CEO VoiceQube
Sandeep Soni
Founder & CEO Deccansoft, Microsoft Certified Trainer
Parveen Malik
AVP InfoSec & Vulnerability Management, Information Security Expert
Nitin Pandit
Microsoft MVP, Developer Evangelist, Author
Niloshima Srivastava
C# Corner MVP, Tech Architect, Trainer, Blogger
Bala Chirtsabesan
Senior Software Engineer at Microsoft, Author
Manoj Mittal
Sr. Technical Architect, C# Corner MVP, Author
Chandni Di
Co-Founder Voice of Slum
Vithal Wadje
Technical Lead, Microsoft MVP, Author
Shivam Ahuja
Founder SkillCircle, Business Mentor
Chervine Bhiwoo
Solution Architect, Microsoft MVP, Author
Saurabh Jain
Vice President Paytm, Founder Fun2Do Labs, Author
Vinay Solanki
Head IoT at Lenovo, Founder IoT-NCR
Anshu kumari
Founder Blockchainkids, Inventor, Trainer
Amit Singal
CEO Startup Buddy
Dev Pratap
Co-Founder & CEO Voice of Slum
Amey Vartak
Technology Consultant, Full Stack Developer, C# Corner MVP, Author
Viswanatha Swamy
Principal Software Engineer, C# Corner MVP, Author
Sanket Verma
Research Engineer @ Ballistics (Forensics) and Chair, PyData Delhi
Sourabh Somani
Lead Developer, Microsoft MVP, Author
Abhishek Mishra
Software Architect, C# Corner MVP, Author
Siddharth Vaghasia
Technical Consultant, C# Corner MVP, Blogger
Bassam Alugili
Senior Software Specialist, Database Expert
S Ravi Kumar
Solution Architect, C# Corner MVP, Author
Sundaram Subramanian
Full Stack Developer, C# Corner MVP, Speaker
Deepesh Somani
Solution Architect, Microsoft MVP, Author
Debasis Saha
Technical Project Manager, C# Corner MVP, Blogger, Author
Vipul Jain
Software Architect, C# Corner MVP, Author
Akshay Patel
Technical Architect, Microsoft Certified Trainer, C# Corner MVP, Author
Stephen Simon
RPA Developer, Evangelist, Author
Vivek Sharma
Founder Kingster636, AR/VR Specialist
Jeetendra Gund
Technical Lead, C# Corner MVP, Author
Sujal Beniwal
AI Enthusiast, Student
M Viknaraj
Microsoft MVP, Azure Architect, Author
Prasham Sabadra
Software Architect, C# Corner MVP, Trainer, Author
Aakash Maurya
Senior Developer, C# Corner MVP, Speaker
Ankit Sharma
Senior Software Engineer, C# Corner MVP, Author
Mangesh Gaherwar
Team Lead, C# Corner MVP, Author
Viral Jain
Technical Consultant, C# Corner MVP, Author
Bhasker Das
Solution Architect, Evangelist
Manish Dwivedi
Associate Project Manager
Ck Nitin
Programmer, Author
Rohit Gupta
Technical Trainer, Author
Manish Tewatia
Full-stack Marketer, UX Designer
Bhavya Gaur
Technical Illustrator
Rohit Tomar
SEO/SMO Expert
Web Track
Cloud & Data Track
Dev Track
Registration & Breakfast
Future of Desktop Apps with JS (ElectronJs)
Nitin Pandit
Building Serverless Microservices Using Microsoft Azure
Vithal Wadje
Innovating RPA: A Robot for Every Person
Stephen Simon
Managing Cloud Storage Accounts using Logic Apps
Viknaraj Manogararajah
Data visualization using Python
Sekhar Srinivasan
Going Cross platform with AR Foundation
Vivek Sharma
Keynote
Managing your Azure dependencies in ASP.NET Core apps using VS
Bala Chirtsabesan
Securing Applications on Intelligent Azure
Abhishek Mishra
Getting started with Blazor the Framework of Future
S Ravi Kumar
Lunch
Build Progressive Web Apps using Angular 9
Debasis Saha
Build and deploy to any platform using Azure DevOps
Chervine Bhiwoo
Deep Dive in Azure Service Bus
Akshay Patel
Build a Native Mobile Application using React Native and JavaScript
Joseph Guadagno
Making sense of Web Job, Web Job SDK and Functions in Azure
Prakash Tripathi
CloudFront Distribution in AWS
Viral Jain
Tea Break
Introduction to PowerBI
Aakash Maurya
Build Advanced SPFx solutions with React and Graph API
Siddharth Vaghasia
Build Business Intelligence Analyst (BIA) Skills
Sundaram Subramanian
Deep dive of Power Platform – AI BUILDER
Prasham Sabadra
Panel 1
What's new in SharePoint development
Vipul Jain
Build a SSO (Single Sign On) based Native JavaScript application with Microsoft Identity within 10 minutes
Manoj Mittal
Panel 2
Applications and working of AI
Veena Sarda
Deploying serverless API's with .Net core 3.0 on AWS & Azure
Amey Vartak
Panel 3
Blockchain with .NET Core (Ark)
Anshu Kumari
Closing Note & Prize Distribution
Dev Track
Cloud Track
Architecture Track
Emerging Tech Track
Registration & Breakfast
Creating Full-Stack Web Apps Using Server-Side Blazor
Ankit Sharma
Real time face recognition with MS Cognitive Services
Niloshima Srivastava
Building Scalable APIs with GraphQL
Jeetendra Gund
Future of development with AI and Blockchain
Navdeep Garg
Debugging Tips and Tricks with Visual Studio 2019
Joseph Guadagno
Azure Containers
Abhishek Kant
Enterprise Architecture
Naveen Sharma
Bot Framework - learn it fast and look like a boss!
Allen O’Neill
Keynote
.Net Core & C# 8 Performance
David McCarter
Working with Azure kubernetes services
Ritesh Modi
Becoming an Architect
Vidyavrat Agarwal
Why Techies Need to Learn Product Management
Saurabh Jain
Lunch
Build a rules engine in .Net Core
Sanjay Vyas
Building CI and CD Pipeline using Azure DevOps
Sandeep Soni
Entity Framework Core - Tips and Tricks, Performance Optimization, and Tuning
Bassam Alugili
Hacking your way into Data Science
Sanket Verma
Speed up your .Net Core Website
Sourabh Somani
Azure
Magnus Mårtensson
Demystifying Open Distro for Elasticsearch
Suman Debnath
Future of Data
Shivam Ahuja
Tea Break
gRPC with C# and .Net Core
Mangesh Gaherwar
Panel 1
Essentials of Cloud security
Parveen Malik
Power platform and Dynamics 365
Deepesh Somani
Microservices - the gRPC Way
Viswanatha Swamy
Panel 2
Reserved
Reserved
Closing Note & Prize Distribution
Building resilient streaming endpoints with CancellationToken records
Streaming responses have moved from a niche feature into a daily workhorse for .NET teams. Whether you are pushing market data to a dashboard in Sydney, feeding sensor readings into a machine learning pipeline in Melbourne, or signalling progress from a long-running job to a browser in Brisbane, the standard pattern rarely looks like a one-shot return any more. Modern applications assume that bytes flow in chunks over time, that clients connect and disconnect unpredictably, and that networks drop in the middle of a transaction.
This shift has put cancellation under the spotlight. A streaming endpoint that never times out or never honours a client disconnect can leak worker threads, hold buffers in memory, and chew through bandwidth on a regional NBN link long after the requester has moved on. In Australia, where workloads are often stretched between capital cities and remote sites with intermittent connectivity, the cost of poor cancellation hygiene grows quickly.
A clean way to manage this in C# 9 and later is to combine IAsyncEnumerable<T> with a small, purpose-built record that packages a CancellationToken together with the metadata a streaming endpoint actually needs. The pattern keeps the async stream idiomatic, gives the host a single object to inspect, and lets background workers cooperate without spaghetti logic.
Why streaming endpoints need cooperative cancellation
Cooperative cancellation is the only kind that actually works in managed code. The runtime cannot just yank a thread out from under a Stream.CopyToAsync call without risking torn buffers and unhandled exceptions. The CancellationToken exists so that the producing code can observe a signal, stop what it is doing cleanly, and free the resources it had reserved.
In a streaming endpoint, the implications multiply. A controller method returning IAsyncEnumerable<T> is technically a state machine that the framework pulls on a slice at a time. Each yield is an opportunity to bail out, but only if the developer remembers to ask token.ThrowIfCancellationRequested() inside the loop. Without those checks, an upstream closed socket just sits idle while the database keeps polling, and the GC keeps allocating.
That setup matters in Australian contexts where latency is not always predictable. A user querying ASIC business registry data from a mobile connection on the Yorke Peninsula is not the same as someone parked at a desk in Parramatta. Endpoints that assume a flat latency profile tend to over-fetch on slower links, which in turn means more time sitting in memory waiting to be cancelled.
Anatomy of IAsyncEnumerable and token flow
IAsyncEnumerable<T> arrived with C# 8 and quietly raised the floor for asynchronous programming. The interface exposes a single GetAsyncEnumerator method that returns an IAsyncEnumerator<T>, which in turn supports MoveNextAsync and the familiar Current property. Because MoveNextAsync returns a ValueTask<bool>, callers can hang tight without blocking a thread, and the producer can yield values lazily.
The interface includes a default CancellationToken parameter on GetAsyncEnumerator. When a caller passes a token through, the producer is expected to honour it at every await point. ASP.NET Core pushes its request-aborted token through automatically when the framework recognises the parameter, so applications get cancellation for free when the response stream is flushed and the client disconnects.
The trick is layering business-level cancellation on top of that. A streaming endpoint that exports cheque clearance records for an ATO reconciliation job should not only stop when the client goes away, it should stop when an internal deadline fires, when a downstream dependency becomes unhealthy, or when an administrator manually pauses the stream. Each of those triggers should be a CancellationTokenSource that gets composed into a single token the loop can observe.
Designing a CancellationTokenRecord wrapper
A CancellationTokenRecord is a natural fit for the language feature with the same name. In C# 9 or later, declaring a positional record gives you value equality, immutability, and a clean syntax for moving the structure around. The wrapper typically bundles a token with the reason for cancellation, a deadline expressed in Australian Eastern Standard Time for clarity, and a correlation identifier that ends up in the application log.
public record CancellationTokenRecord(
CancellationToken Token,
string Reason,
DateTimeOffset DeadlineLocal,
string CorrelationId);
The real benefit surfaces when the helper exposes a few small operations. A WithReason(string) factory method returns a new record when circumstances change. A combined static method accepts multiple sources and produces a single linked token plus a record that aggregates the originating reasons. That single object can then travel into repositories, background services, and controller actions without anyone needing to chase three different parameters.
In Australian teams, the deadline is usually expressed in Australia/Sydney time even when the server is hosted elsewhere, because that is the timezone the operations team reads clocks in. Building the convention into the record saves a lot of small but confusing bugs where deadlines are silently off by a few hours, the sort of subtle drift that any code reviewer in Melbourne would likely catch on a Wednesday afternoon.
Wiring the record into ASP.NET Core endpoints
Once the record exists, the controller method becomes pleasantly small. The action binds the record through dependency injection, hands it into the repository, and yields values as they arrive. ASP.NET Core links the framework token with the record token using CancellationTokenSource.CreateLinkedTokenSource, so any of the triggers tearing down the connection also tears down the response.
[HttpGet("stream")]
public async IAsyncEnumerable<TradeEvent> StreamAsync(
[FromServices] CancellationTokenRecord record,
[EnumeratorCancellation] CancellationToken frameworkToken)
{
using var linked = CancellationTokenSource
.CreateLinkedTokenSource(record.Token, frameworkToken);
await foreach (var trade in _repository
.WatchTradesAsync(linked.Token, record.Reason))
{
yield return trade;
}
}
The [EnumeratorCancellation] attribute is the small detail that ties everything together. Without it, the framework cannot propagate its own token into the async iterator, and the only signal your loop sees is the business-level one. With it, a slow consumer closing the tab and an admin pressing the emergency stop button both result in the same clean unwind, the same log entry, and the same release of upstream sockets.
This is particularly handy for SignalR hubs running across regions. A hub group hosted in Sydney serving subscribers in Perth can use the record to attach a per-connection timeout, log when a connection dies, and propagate a deadline down to the database call so the cancellation actually reaches the query plan.
Comparing cancellation approaches across real-world scenarios
Not every project needs a record. A quick look at the choices helps to pick the right tool for the right job.
| Approach | Strengths | Weaknesses | Best fit |
|---|---|---|---|
Plain CancellationToken parameter |
Lightweight, idiomatic, requires no extra types | Loses metadata, easy to forget context, harder to log meaningfully | Simple endpoints with a single source of cancellation |
CancellationTokenRegistration callbacks |
Lets you hook cleanup and tracing directly | Couples callback lifetime with token lifetime, can leak when overused | Cases requiring precise teardown of unmanaged resources |
CancellationTokenRecord wrapper |
Carries reason, deadline, and correlation id; flows through layers cleanly | Slight ceremony, requires a project-wide convention | Multi-tenant APIs, observability dashboards, compliance-heavy workloads |
Channels plus manual flag |
Total control over back-pressure and producer/consumer pacing | More code to maintain, easy to drift away from cancellation semantics | Custom protocols, batched pipelines, in-process fan-out |
The record approach usually pays for itself once an endpoint crosses into anything resembling production. Compliance audits tend to ask precise questions about who cancelled what and when, and the metadata flowing through the wrapper answers them without anyone needing to instrument the logs after the fact. The discipline also makes integration tests easier, since the cancellation path can be exercised deliberately rather than discovered only when a flaky CI build finally drops a connection at the wrong moment.
Practical habits for day-to-day streaming code
- Always thread a
CancellationTokenRecordinto repository and service methods, even if the immediate call site does not need it, so cancellation is never one layer away from being honoured. - Set deadlines in
Australia/Sydney(or the customer-facing timezone) so application logs and incident timelines line up with operational expectations. - Log on cancellation with the correlation id from the record, not just the time, so a single trace can be followed end-to-end through application code and infrastructure tooling.
- Avoid buffering full result sets before yielding, emit each item as soon as it arrives and check the token between yields to keep memory flat under load.
- Treat timeout values as configuration rather than constants, especially for endpoints that reach customers outside the capital cities where NBN and enterprise link variability shape the realistic upper bound on stream length.
1, CBD, Maharaj Surajmal Road, Near Yamuna Sports Complex, Delhi, 110032
GENERAL QUERIES
Manish Tewatia
manish@csharpcon.com
+91-9718-431-042
TICKET QUERIES
Atul Gupta
conference@csharpcon.com
+91-9910-125-804