This website requires JavaScript.
0
Pull Requests
Explore
Active Time Tracker
#
0
Create…
New Repository
New Migration
anonymous
Signed in as
anonymous
Profile
Subscriptions
Settings
Help
Sign Out
common
/
machinery-plugins
Private
Watch
1
Fork
You've already forked machinery-plugins
Fork to a different account
0
Code
Pull Requests
Releases
Activity
machinery-plugins
/
examples
/
tasks
/
or
Cancel
Edit File
Preview
Preview Changes
package tasks import ( "errors" "strings" "time" "github.com/RichardKnop/machinery/v2/log" ) // Add ... func Add(args ...int64) (int64, error) { sum := int64(0) for _, arg := range args { sum += arg } return sum, nil } // Multiply ... func Multiply(args ...int64) (int64, error) { sum := int64(1) for _, arg := range args { sum *= arg } return sum, nil } // SumInts ... func SumInts(numbers []int64) (int64, error) { var sum int64 for _, num := range numbers { sum += num } return sum, nil } // SumFloats ... func SumFloats(numbers []float64) (float64, error) { var sum float64 for _, num := range numbers { sum += num } return sum, nil } // Concat ... func Concat(strs []string) (string, error) { var res string for _, s := range strs { res += s } return res, nil } // Split ... func Split(str string) ([]string, error) { return strings.Split(str, ""), nil } // PanicTask ... func PanicTask() (string, error) { panic(errors.New("oops")) } // LongRunningTask ... func LongRunningTask() error { log.INFO.Print("Long running task started") for i := 0; i < 10; i++ { log.INFO.Print(10 - i) time.Sleep(1 * time.Second) } log.INFO.Print("Long running task finished") return nil }
Loading…
Loading…
Commit Changes
Add a Signed-off-by trailer by the committer at the end of the commit log message.
Commit directly to the
main
branch.
Create a
new branch
for this commit and start a pull request.
Commit Changes
Cancel
Commit an empty file
The file you're about to commit is empty. Proceed?
Cancel
Commit Changes