https://github.com/cdwaddell/aspbackgroundworker
A dotnet Standard 2.0 library for scheduling a background job to periodically run inside of an ASP.NET core application.
https://github.com/cdwaddell/aspbackgroundworker
background-worker dotnet-standard nuget-package
Last synced: 3 months ago
JSON representation
A dotnet Standard 2.0 library for scheduling a background job to periodically run inside of an ASP.NET core application.
- Host: GitHub
- URL: https://github.com/cdwaddell/aspbackgroundworker
- Owner: cdwaddell
- License: mit
- Created: 2017-09-09T14:45:03.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-09-11T15:59:09.000Z (almost 9 years ago)
- Last Synced: 2025-06-29T10:04:55.086Z (12 months ago)
- Topics: background-worker, dotnet-standard, nuget-package
- Language: C#
- Homepage:
- Size: 20.5 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Titanosoft.AspBackgroundWorker

### What is AspBackgroundWorker?
AspBackgroundWorker is a dotnet Standard 2.0 library for scheduling a background job to periodically run inside of an ASP.NET core application.
### How do I get started?
1. install the nuget package:
```
PM> Install-Package Titanosoft.AspBackgroundWorker
```
2. Configure logging however you wish. Read more about logging here: [Logging in ASP.Net Core](https://docs.microsoft.com/en-us/aspnet/core/fundamentals/logging?tabs=aspnetcore2x)
3. Configure your background job, by adding something like this to your confguration section (in Startup.cs):
```csharp
app.UseBackgroundTask(new RecurringBackgroundTask(
"NewTask", //A unique name
new TimeSpan(0,1,0), //Run every minute,
(serviceProvider, cancellationToken) => {
//Your code that uses the service proveder and cancels when the cancellationtoken is cancelled
}}
)
{
RunImmediately = true //Run now or wait until the first scheduled instance
})
```