Skip to content

HakanUcaar/Cronable

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Cronable

Add cron job ability to your class methods

Usage

Implement

    public interface ITest : ICronable
    {
    }
    
    public class Test : ITest
    {
        public List<ICronJob> CronJobs { get; set; } = new();
      
        //My Attribute trigger every minute
        [CronJob("* * * * *")]
        public void TestMethod()
        {
            Console.WriteLine("TestMethod execute");
        }
        
        //My Attribute trigger every minute
        [CronJob("* * * * *")]
        public Task Test2Method()
        {
            return Task.Run(()=> Console.WriteLine("TestMethod2 execute"));
        }
    }  

Start jobs

  testClass.RegisterJobs().StartJobsAsync(CancellationToken.None);

Output

  TestMethod execute
  TestMethod2 execute

referance repo : https://github.com/furkandeveloper/EasyCronJob

About

Add cron job ability to your class methods

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy