Ecosyste.ms: Packages

An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

Top 2.7% on proxy.golang.org
Top 1.4% dependent packages on proxy.golang.org
Top 1.6% dependent repos on proxy.golang.org
Top 5.6% forks on proxy.golang.org
Top 0.8% docker downloads on proxy.golang.org

proxy.golang.org : github.com/madflojo/tasks

Package tasks is an easy to use in-process scheduler for recurring tasks in Go. Tasks is focused on high frequency tasks that run quick, and often. The goal of Tasks is to support concurrent running tasks at scale without scheduler induced jitter. Tasks is focused on accuracy of task execution. To do this each task is called within it's own goroutine. This ensures that long execution of a single invocation does not throw the schedule as a whole off track. As usage of this scheduler scales, it is expected to have a larger number of sleeping goroutines. As it is designed to leverage Go's ability to optimize goroutine CPU scheduling. For simplicity this task scheduler uses the time.Duration type to specify intervals. This allows for a simple interface and flexible control over when tasks are executed. Below is an example of starting the scheduler and registering a new task that runs every 30 seconds. Sometimes schedules need to started at a later time. This package provides the ability to start a task only after a certain time. The below example shows this in practice. It is also common for applications to run a task only once. The below example shows scheduling a task to run only once after waiting for 60 seconds. One powerful feature of Tasks is that it allows users to specify custom error handling. This is done by allowing users to define a function that is called when a task returns an error. The below example shows scheduling a task that logs when an error occurs.

Registry - Source - Documentation - JSON
purl: pkg:golang/github.com/madflojo/tasks
Keywords: golang, scheduler, task
License: MIT
Latest release: 11 months ago
First release: over 4 years ago
Namespace: github.com/madflojo
Dependent packages: 14
Dependent repositories: 11
Stars: 142 on GitHub
Forks: 15 on GitHub
Docker dependents: 4
Docker downloads: 28,412
See more repository details: repos.ecosyste.ms
Last synced: 27 days ago

    Loading...
    Readme
    Loading...