Skip to content

Commit 4b5f49b

Browse files
committed
target latest byte-streams, mark 0.1.5
1 parent e5e069d commit 4b5f49b

File tree

3 files changed

+15
-17
lines changed

3 files changed

+15
-17
lines changed

README.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ This library implements a disk-backed task queue, allowing for queues that can s
55
### usage
66

77
```clj
8-
[factual/durable-queue "0.1.3"]
8+
[factual/durable-queue "0.1.5"]
99
```
1010

1111
To interact with queues, first create a `queues` object by specifying a directory in the filesystem and an options map:
@@ -49,11 +49,11 @@ To get a description of the current state of the queue, we can use `stats`, whic
4949

5050
```clj
5151
> (stats q)
52-
{:enqueued 2,
53-
:retried 0,
54-
:completed 1,
55-
:in-progress 1,
56-
:num-slabs 1,
52+
{:enqueued 2,
53+
:retried 0,
54+
:completed 1,
55+
:in-progress 1,
56+
:num-slabs 1,
5757
:num-active-slabs 1}
5858
```
5959

@@ -68,7 +68,7 @@ To get a description of the current state of the queue, we can use `stats`, whic
6868

6969
### configuring the queues
7070

71-
`queues` can be given a number of different options, which can affect its performance and correctness.
71+
`queues` can be given a number of different options, which can affect its performance and correctness.
7272

7373
By default, it is assumed all tasks are idempotent. This is necessary, since the process can die at any time and leave an in-progress task in an undefined state. If your tasks are not idempotent, a `:complete?` predicate can be defined which, on instantiation of the `queues` object, will scan through all pre-existing task descriptors and remove those for which the predicate returns true.
7474

@@ -77,7 +77,7 @@ A complete list of options is as follows:
7777
| name | description |
7878
|------|-------------|
7979
| `:complete?` | a predicate for identifying already completed tasks, defaults to always returning false |
80-
| `:max-queue-size` | the maximum number of elements that can be in the queue before `put!` blocks, defaults to `Integer/MAX_VALUE` |
80+
| `:max-queue-size` | the maximum number of elements that can be in the queue before `put!` blocks, defaults to `Integer/MAX_VALUE` |
8181
| `:slab-size` | The size, in bytes, of the backing files for the queue. The size of a serialized task cannot be larger than this size, defaults to 64mb. |
8282
| `:fsync-put?` | Whether an fsync should be performed for each `put!`. Defaults to `true`. |
8383
| `:fsync-take?` | Whether an fsync should be performed for each `take!`. Defaults to `false`. |
@@ -90,6 +90,6 @@ Writes can be batched using `fsync-threshold` and/or `fsync-interval`, or by exp
9090

9191
### license
9292

93-
Copyright © 2013 Factual Inc
93+
Copyright © 2015 Factual Inc
9494

9595
Distributed under the Eclipse Public License 1.0

project.clj

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
(defproject factual/durable-queue "0.1.3"
1+
(defproject factual/durable-queue "0.1.5"
22
:description "a in-process task-queue that is backed by disk."
33
:license {:name "Eclipse Public License"
44
:url "http://www.eclipse.org/legal/epl-v10.html"}
5-
:dependencies [[com.taoensso/nippy "2.5.2"]
6-
[primitive-math "0.1.3"]
7-
[byte-streams "0.1.9"]
8-
[manifold "0.1.0-alpha3"]]
5+
:dependencies [[com.taoensso/nippy "2.8.0"]
6+
[primitive-math "0.1.4"]
7+
[byte-streams "0.2.0"]]
98
:profiles {:dev {:dependencies [[org.clojure/clojure "1.5.1"]
109
[criterium "0.4.3"]
1110
[codox-md "0.2.0" :exclusions [org.clojure/clojure]]]}}

src/durable_queue.clj

+2-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
[byte-streams :as bs]
55
[clojure.string :as str]
66
[primitive-math :as p]
7-
[manifold.stream :as s]
87
[taoensso.nippy :as nippy])
98
(:import
109
[java.lang.reflect
@@ -199,7 +198,7 @@
199198
ary (bs/to-byte-array (.position buf header-size))]
200199
(when-not (== (checksum (.getInt buf 10) ary) checksum')
201200
(throw (IOException. "checksum mismatch")))
202-
(nippy/thaw-from-bytes ary))))))
201+
(nippy/thaw ary))))))
203202

204203
(defmethod print-method Task [t ^Writer w]
205204
(.write w
@@ -446,7 +445,7 @@
446445
[_ q-name task-descriptor]
447446
[_ q-name task-descriptor timeout]
448447
"A blocking enqueue to `name`. If `timeout` is specified, returns `false` if unable to
449-
enqueue within `timeout` milliseconds."))
448+
enqueue within `timeout` milliseconds, `true` otherwise."))
450449

451450
(defn queues
452451
"Creates a point of interaction for queues, backed by disk storage in `directory`.

0 commit comments

Comments
 (0)