Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/rveach/scheduler

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/rveach/scheduler

  • v0.0.0-20130419192206-888d1877d2ef
  • Source
  • Go
  • Socket score

Version published
Created
Source

scheduler

scheduler is meant to be a lightweight and flexible job scheduler

A Job is an interface that is made up of 3 parts:

  • NextRunTime() Which takes a time.Time as input and returns the next time the Job should be run

  • Run() takes no parameters and is the function that gets called when it is time to run the job

  • GetID() returns an uint that is used to identify the job for updating or removing the job from the scheduler

What's Included

  • The scheduler itself

  • A simple ID type that can be dropped into a struct to Satisfy the GetID() requirement for a Job

  • A CronTime type that specifies NextRunTime() using the standard Cron Syntax (except for starting with seconds instead of minutes)

To get started you only need to define a function (Run()) and drop it into a struct along with ID and CronTime (and initialize them) and you are ready to add your Job to the scheduler.

Of course you are free to implement your own GetID() or NextRunTime()

FAQs

Package last updated on 19 Apr 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc