© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•4y ago•
3 replies
CrosRoad95

❔ Batching actions

I have a technical question, let's say i have method that increment counter. The idea is that i would like to call this function multiple times and somehow detect what was the last change
inc();inc();inc(); - emit event notifying that counter = 3
inc();inc();inc(); - emit event notifying that counter = 3

right now i solved it by adding await Task.Delay that wait for few miliseconds, if new change arrive - cancel previous delay and begin delay again. if no new state change arrive - dispatch it
anyone have a smarter solution?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

❔ Batching
C#CC# / help
3y ago
Source Generator AdditionalFiles Batching missing metadata
C#CC# / help
2y ago
shared variables between actions
C#CC# / help
4y ago
2 actions in one method
C#CC# / help
2y ago