TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Hakan Axheim
NA
201
32.5k
Regarding: Windows Service programming
Feb 16 2021 8:47 AM
Hi,
I am trying to build a Windows Service in C#.
I have created the project in Visual Studio 2019 with template Worker Service.
As default it will be created a method:in the Worker.cs class
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
In that method there is a while loop where I want to call a method in which I shall select values from a database.
In this while loop I have a Task.Delay for some seconds, and this delay is configurable in the appsettings.json.
But I want this program to wait for the selection from the database is finished, i.e. if I have set the delay to 2 seconds and the database selection will take 3 seconds. Then I wan't a larger delay.
How can I do that?
Reply
Answers (
1
)
Integrated development environment for Asp.net C# application
Create User Using Google Directory API with C#