Kohai
❔ Asynchronously events handling flow
Hi, I am writing a bot and I don't know how to organize events handling with tasks.
I have class that implements these methods:
The actions flow is follow:
StartPolling() listens to a server for events. When the events are received, it should run task that creates kind of threads to handle each event by calling HandleUpdateAsync(GroupUpdate update) and keep listening to the server.
So the question is how to do that?
My version is follow but I guess it blocks current thread until the lambda function is not over because of await word before Task.Run(). When I remove await, Rider warns me to put that word.
the whole code:
2 replies