-
-
Save lukaszkorecki/0a3233e29b7ce6d8dc24ec68255c769b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns omega-red.redis-test | |
(:require [omega-red.protocol :as proto] | |
[omega-red.redis] | |
[com.stuartsierra.component :as component])) | |
(let [red (componet/start (omega-red.redis/create {:host "127.0.0.1" :port 6379}))] | |
(println (= 0 (proto/execute red :exists "test.some.key"))) ; true | |
(println (= "OK" (proto/execute red :set "test.some.key" "foo"))) ; true | |
(println (= 1 (proto/execute red :exists "test.some.key"))) ; true | |
(println (= "foo" (proto/execute red :get "test.some.key"))) ; true | |
(println (= 1 (proto/execute red :del "test.some.key"))) ; true | |
(component/stop red) | |
(println (nil? (proto/execute red :get "test.some.key")))) ; true | |
;; pipeline execution | |
(println (= [nil "OK" "oh ok" 1] | |
(proto/execute-pipeline red | |
[:get "test.some.key.pipe"] | |
[:set "test.some.key.pipe" "oh ok"] | |
[:get "test.some.key.pipe"] | |
[:del "test.some.key.pipe"]))) ; true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment