Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
ale
disque
Commits
98714c8d
Commit
98714c8d
authored
Apr 30, 2015
by
Vojtech Vitek (V-Teq)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add README
parent
06fdac9c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
0 deletions
+48
-0
README.md
README.md
+48
-0
No files found.
README.md
0 → 100644
View file @
98714c8d
# pjobs
Persistent Distributed Job Priority Queue for
[
golang
](
http://golang.org/
)
powered by
[
Disque
](
https://github.com/antirez/disque
)
.
-
**Persistent**
- Jobs can be persisted on disk.
-
**Distributed**
- Multiple producers, multiple consumers.
-
**Job Priority Queue**
- Consumers dequeue "high" priority jobs first.
-
**Tolerant to consumer failures**
- Jobs are requeued automatically if not ACKed within the Retry Timeout.
[

](https://godoc.org/github.com/goware/pjobs)
[

](https://travis-ci.org/goware/pjobs)
**This project is in early development stage. You can expect changes to both functionality and the API. Feedback welcome!**
## Disque
Install & run
[
Disque
](
https://github.com/antirez/disque
)
server.
*TODO: Explain how to enable disk persistence.*
## Producers
```
go
// Connect to Disque server.
jobs
,
_
:=
pjobs
.
Connect
(
"127.0.0.1:7711"
)
// Enqueue job (data + priority).
job
,
_
:=
jobs
.
Enqueue
(
"data"
,
"low"
)
job
,
_
:=
jobs
.
Enqueue
(
"data"
,
"high"
)
```
## Consumers
```
go
// Connect to Disque server.
jobs
,
_
:=
pjobs
.
Connect
(
"127.0.0.1:7711"
)
// Dequeue job ("high" priority jobs first).
job
,
_
:=
jobs
.
Dequeue
(
"high"
,
"low"
)
// Do some hard work with job.Data.
// Acknowledge that job was processed successfully.
jobs
.
Ack
(
job
)
```
## License
Pjobs is licensed under the
[
MIT License
](
./LICENSE
)
.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment