Documentation
¶
Overview ¶
Example ¶
Example illustrates the use of rque
package main
import (
"fmt"
"log"
"time"
"github.com/frozzare/go-rque"
)
func main() {
que, err := rque.New(rque.Config{
Address: "localhost:28015",
Database: "test",
Table: "queue",
})
if err != nil {
log.Fatalf("Failed to create que: %s", err)
}
go func() {
time.Sleep(500 * time.Millisecond)
que.PostJob(rque.Job{
ID: "1",
Name: "World",
})
time.Sleep(500 * time.Millisecond)
que.PostJob(rque.Job{
ID: "1",
Name: "Goodbye",
})
time.Sleep(500 * time.Millisecond)
que.Quit()
}()
for job := range que.Jobs() {
fmt.Printf("Hello %s\n", job.Name)
}
}
Output: Hello World Hello Goodbye
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Job ¶
type Job struct {
ID string `gorethink:"id,omitempty" json:"id"`
Name string `gorethink:"name" json:"name"`
Data interface{} `gorethink:"data,omitempty" json:"data"`
}
Job represent a job in the database
Click to show internal directories.
Click to hide internal directories.