DeveloperHelper | help developers
kandi X-RAY | DeveloperHelper Summary
kandi X-RAY | DeveloperHelper Summary
📌Easy Development is a tool to help developers develop quickly. Its functions include interface analysis, page information, hardening and shelling, and support Android9.0
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of DeveloperHelper
DeveloperHelper Key Features
DeveloperHelper Examples and Code Snippets
Community Discussions
Trending Discussions on DeveloperHelper
QUESTION
I am writing a c# console app base on net core 3.1 linux
It was expected to
- run job async
- await job end
- catch the kill signal and do some clean job
here is my demo code:
...ANSWER
Answered 2020-Aug-05 at 17:19Ok, this may be a tad long winded, but here it goes.
The main issue here is HttpListener.GetContextAsync()
does not support cancellation via CancellationToken
. So it's tough to cancel this operation in a somewhat graceful manner. What we need to do is "fake" a cancellation.
Stephen Toub is a master in the async
/await
pattern. Luckily for us he wrote an article entitled How do I cancel non-cancelable async operations?. You can check it out here.
I don't believe in using the AppDomain.CurrentDomain.ProcessExit
event. You can read up on why some folks try to avoid it.
I will use the Console.CancelKeyPress event though.
So, in the program file, I have set it up like this:
Program.cs
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install DeveloperHelper
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page