Skip to content

Commit

Permalink
[nop] Housekeeping
Browse files Browse the repository at this point in the history
  • Loading branch information
ptaoussanis committed May 29, 2024
1 parent b86e337 commit 1595efe
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 22 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ And as always **please report any unexpected problems** - thank you! 🙏

## New since `v3.3.2` (2023-10-24)

* 8196415f [new] Update Redis command spec (2024-05-27)
* 12c4100d [new] Update Redis command spec (2024-05-27)
* Several wiki and docstring improvements

---
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ See [here][GitHub releases] for earlier releases.
## Why Carmine?

- High-performance **pure-Clojure** library
- [Fully documented API](#documentation) with support for the **latest Redis commands and features**
- [Fully documented API](https://cljdoc.org/d/com.taoensso/carmine/CURRENT/api/taoensso.carmine) with support for the **latest Redis commands and features**
- Easy-to-use, production-ready **connection pooling**
- Auto **de/serialization** of Clojure data types via [Nippy](https://www.taoensso.com/nippy)
- Fast, simple **message queue** API
- Fast, simple **distributed lock** API
- Fast, simple [message queue](../../wiki/3-Message-queue) API
- Fast, simple [distributed lock](https://cljdoc.org/d/com.taoensso/carmine/CURRENT/api/taoensso.carmine.locks) API

## Documentation

Expand Down
5 changes: 3 additions & 2 deletions src/taoensso/carmine/connections.clj
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
(ns taoensso.carmine.connections
"Handles socket connection lifecycle. Pool is implemented with Apache Commons
pool. Originally adapted from redis-clojure."
"Handles socket connection lifecycle.
Pool is implemented with Apache Commons pool.
Originally adapted from `redis-clojure`."
{:author "Peter Taoussanis"}
(:require
[clojure.string :as str]
Expand Down
11 changes: 6 additions & 5 deletions src/taoensso/carmine/locks.clj
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
(ns taoensso.carmine.locks
"Alpha - subject to change.
Distributed lock implementation for Carmine based on work by Ronen Narkis
and Josiah Carlson. Redis 2.6+.
Distributed lock implementation for Carmine.
Based on work by Ronen Narkis and Josiah Carlson.
Redis keys:
* carmine:lock:<lock-name> -> ttl str, lock owner's UUID.
Ref. http://goo.gl/5UalQ for implementation details."
(:require [taoensso.timbre :as timbre]
[taoensso.carmine :as car :refer (wcar)]))
Ref. <http://goo.gl/5UalQ> for implementation details."
(:require
[taoensso.timbre :as timbre]
[taoensso.carmine :as car :refer (wcar)]))

(def ^:private lkey (partial car/key :carmine :lock))

Expand Down
22 changes: 12 additions & 10 deletions src/taoensso/carmine/ring.clj
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
(ns taoensso.carmine.ring
"Carmine-backed Ring session store."
{:author "Peter Taoussanis"}
(:require [ring.middleware.session]
[taoensso.encore :as enc]
[taoensso.carmine :as car :refer (wcar)]))
(:require
[ring.middleware.session]
[taoensso.encore :as enc]
[taoensso.carmine :as car :refer [wcar]]))

(defrecord CarmineSessionStore [conn-opts prefix ttl-secs extend-on-read?]
ring.middleware.session.store/SessionStore
Expand All @@ -24,21 +25,22 @@
k)))

(defn carmine-store
"Creates and returns a Carmine-backed Ring SessionStore.
"Creates and returns a Carmine-backed Ring `SessionStore`.
Options include:
:expiration-secs - How long session data should persist after last
write. nil => persist forever.
:extend-on-read? - If true, expiration will also be extended by
session reads."
`:expiration-secs` - How long session data should persist after last
write. nil => persist forever.
`:extend-on-read?` - If true, expiration will also be extended by
session reads."
[conn-opts & [{:keys [key-prefix expiration-secs extend-on-read?]
:or {key-prefix "carmine:session"
expiration-secs (enc/secs :days 30)
extend-on-read? false}}]]
(->CarmineSessionStore conn-opts key-prefix expiration-secs extend-on-read?))

(enc/deprecated
(defn ^:deprecated make-carmine-store ; 1.x backwards compatiblity
"DEPRECATED. Use `carmine-store` instead."
(defn ^:no-doc ^:deprecated make-carmine-store ; 1.x backwards compatiblity
"Prefer `carmine-store`."
[& [s1 s2 & sn :as args]]
(if (instance? taoensso.carmine.connections.ConnectionPool s1)
(carmine-store {:pool s1 :spec s2} (apply hash-map sn))
Expand Down
3 changes: 2 additions & 1 deletion wiki/3-Message-queue.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ See linked docstrings below for features and usage:

(wcar* (car-mq/enqueue "my-queue" "my message!"))

;; Deref your worker to get detailed status info
@my-worker =>
{:qname "my-queue"
:opts <opts-map>
Expand All @@ -55,4 +56,4 @@ The following semantics are provided:
- Messages are **handled once and only once**.
- Messages are **handled in loose order** (exact order may be affected by the number of concurrent handler threads, and retry/backoff features, etc.).
- Messages are **fault-tolerant** (preserved until acknowledged as handled).
- Messages support optional per-message **de-duplication**, preventing the same message from being simultaneously queued more than once within a specifiable backoff period.
- Messages support optional per-message **de-duplication**, preventing the same message from being simultaneously queued more than once within a configurable per-message backoff period.

0 comments on commit 1595efe

Please sign in to comment.