You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

github.com/scheduler-workspace/scheduler-go

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/scheduler-workspace/scheduler-go

v0.0.0-20210906072402-2d3164406e14
Source
Go
Version published
Created
Source

scheduler-go

GoLang version simple scheduler by onion model

Install

go get -u github.com/hubvue/scheduler

Create Handler

type handler struct {}

func (h handler) Start(data interface{}) interface{} {
    num := data.(int)
    return num + num
}

func (h handler) End(data interface{}) interface{} {
    num := data.(int)
    return num * num
}

Add

Add a handler to the schedule

scheduler.Add(handler{})

Run

execute all handlers in the schedule

res := scheduler.Run(2)
fmt.Println(res) // 16

Remove

remove handler from scheduler

h := handler{}
scheduler.Add(h)
scheduler.Remove(h)

Clear

clear all handlers in the air conditioner

scheduler.Clear()

New Install

create schedule instance

schedule := scheduler.New()

FAQs

Package last updated on 06 Sep 2021

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.