Created
September 16, 2013 17:56
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
`go run echo_wrapper.go echo_worker.go TESTING` # => [TESTING] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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