justdmitry / recurrenttasks Goto Github PK
View Code? Open in Web Editor NEWSimple recurrent tasks for ASP.NET
License: MIT License
Simple recurrent tasks for ASP.NET
License: MIT License
Is there a way to send a cancellation token to the task to stop it?
for example:
app.StartTask<SampleTask>(TimeSpan.FromSeconds(15), TimeSpan.FromSeconds(5), source.Token);
People can ask for deps in the ctor of their IRunnable
implementation, so why provide the ServiceProvider
to the users RunAsnc
?
It would be great to have the cancellation token on IRunnable.Run
as an optional parameter so the new version will just work without any edition to the code.
I'll make a PR for that.
Should bind to actions in IApplicationLifetime
for actually Starting/Stopping tasks
Hello, I was hoping to see a section on the readme related to how to test the code locally before I contribute.
I have a lot of scheduled tasks and a 'scheduled taks monitor', where I can see all statuses etc. In the monitor I also implemented a button to fire 'TryRunImmediately'.
This works for all scheduled tasks with, except 2 tasks that have an interval set to 365 days. Some intervals are set to 7 days, they work. What is the maximum TimeSpan for being able to fire TryRunImmediately?
I'm using third party libraries that have only asynchronous methods. So it is possible to make method Run asynchronous.?
In my ConfigureServices I have:
services.AddTask<UpdateElements>(o => o.AutoStart(TimeSpan.FromSeconds(30)));
And my method looks like:
public class UpdateElements: IRunnable
{
private readonly IElementRepository _elementRepository;
public UpdateElements(IElementRepository elementRepository)
{
_elementRepository= elementRepository;
}
public Task RunAsync(ITask currentTask, IServiceProvider scopeServiceProvider, CancellationToken cancellationToken)
{
return Task.Run(() => {
_elementRepository.UpdateElements();
});
}
}
Now I want to delay the first time with 5 minutes using FirstRunDelay. Where do I need to set this option?
Hi,
I'm experiencing problems with RecurrentTasks. It looks like sometimes a RecurrentTask stops unexpected. In the logfile I find the warning "CancellationToken signaled, stopping...".
But I don't use a CancellationToken. How can I debug why a Recurrent Task is cancelled?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.