Example #1
0
func main() {
	runtime.GOMAXPROCS(5)
	server := redismq.NewServer("localhost:6379", "", 9, "9999")
	server.Start()
	go write("example")
	go read("example", "1")
	go read("example", "2")
	//go read("3")
	select {}
}
Example #2
0
File: load.go Project: jbli/redismq
func main() {
	runtime.GOMAXPROCS(5)
	server := redismq.NewServer("localhost", "6379", "", 9, "9999")
	server.Start()
	queue := redismq.CreateQueue("localhost", "6379", "", 9, "example")
	go write(queue)
	go read(queue, "1")
	go read(queue, "2")
	go read(queue, "3")
	select {}
}
Example #3
0
// This example demonstrates maximum performance
func main() {
	runtime.GOMAXPROCS(5)
	server := redismq.NewServer("localhost:6379", "", 9, "9999")
	server.Start()
	testQueue := redismq.NewBufferedQueue("localhost:6379", "", 9, "example", 100)
	err := testQueue.Start()
	if err != nil {
		panic(err)
	}
	go write(testQueue)
	go read(testQueue, "1")
	go read(testQueue, "2")
	go read(testQueue, "3")
	go read(testQueue, "4")
	select {}
}