Skip to content

Instantly share code, notes, and snippets.

@benmanns
Created September 16, 2013 17:56
Show Gist options
  • Save benmanns/6584142 to your computer and use it in GitHub Desktop.
Save benmanns/6584142 to your computer and use it in GitHub Desktop.
An example of running goworker workers from the command line rather than Redis.
`go run echo_wrapper.go echo_worker.go TESTING` # => [TESTING]
package main
import (
"fmt"
"github.com/benmanns/goworker"
)
func init() {
goworker.Register("Echo", echoWorker)
}
func echoWorker(queue string, args ...interface{}) error {
fmt.Println(args)
return nil
}
package main
import (
"os"
)
func main() {
echoWorker("our_usual_queue", os.Args[1])
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment