recurringtask

package
v0.6.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Start

func Start[S any, A any](self erl.PID, taskFun func(self erl.PID, state S) (S, error), initFun func(self erl.PID, args A) (S, error), args A, opts ...StartOpt) (erl.PID, error)
func StartLink[S any, A any](self erl.PID, taskFun func(self erl.PID, state S) (S, error), initFun func(self erl.PID, args A) (S, error), args A, opts ...StartOpt) (erl.PID, error)

func StartMonitor

func StartMonitor[S any, A any](self erl.PID, taskFun func(self erl.PID, state S) (S, error), initFun func(self erl.PID, args A) (S, error), args A, opts ...StartOpt) (erl.PID, erl.Ref, error)

func Stop

func Stop(self erl.PID, task erl.PID, opts ...genserver.ExitOpt) error

Types

type StartOpt

type StartOpt func(opts *taskOpts) *taskOpts

func SetInterval

func SetInterval(interval time.Duration) StartOpt

How often the task function should run. It is inclusive of task run time. so if the interval is 5m and the task takes 1m to run, the task will run effectively every 6m

func SetName

func SetName(name erl.Name) StartOpt

Register this task with a name

func SetStartTimeout

func SetStartTimeout(tout time.Duration) StartOpt

How long to wait for this process to start before an error is returned

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL