Skip to content

Latest commit

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Memtask

Simple async in memory task execution.

Ideal for small project or webapp.

Usage:

 m := memtask.NewManager(5 * time.Minute)
id := m.Run(ctx, func(ctx context.Context, task Task) error {
// do some work
time.Sleep(1 * time.Second)
// store the results of the work
task.Data = "raw data"
task.Store()
return nil
})
// check the results
task, ok := m.Get(id)
if !ok {...}
if !task.IsFinished() {
// not finished
} // results here
task.Data

About

Simple async in memory task execution

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages