# Packages
No description provided by the author
# README
runqueue
Installation
go get -u github.com/jackal-xmpp/runqueue
Usage
The runqueue
package allows to enqueue and run functions in serial order ensuring exclusive access.
Example
package main
import (
"fmt"
"log"
"github.com/jackal-xmpp/runqueue"
)
func main() {
rq := runqueue.New("rq-1", log.Printf)
var counter int32
for i := 0; i < 2500; i++ {
rq.Run(func() { counter++ })
}
fmt.Println(counter)
}
Expected output:
2500
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request