| 注册
请输入搜索内容

热门搜索

Java Linux MySQL PHP JavaScript Hibernate jQuery Nginx
jopen
12年前发布

RethinkDB 的 Clojure 客户端:revise

revise 是 RethinkDB 的 Clojure 客户端开发包。特点是:异步、无锁、高效以及易用。

示例代码:

(require '[bitemyapp.revise.connection :refer [connect close]])  (require '[bitemyapp.revise.query :as r])  (require '[bitemyapp.revise.core :refer [run]])    ;; connect returns the connection agent  (let [local-conn  (connect) ;; defaults to localhost        ;; pass in connection options map to specify beyond the defaults        remote-conn (connect {:host "99.99.99.1"                              :port 28015                              :auth-key ""})        ;; running a query against a connection returns a promise, the API        ;; and underlying implementation are asynchronous.        response (-> (r/db "test") (r/table-create-db "authors") (run local-conn))]    ;; dereference the promise to block on it.    (println @response)    ;; We are done using the connection    (close local-conn))

项目主页:http://www.open-open.com/lib/view/home/1383612879727

 本文由用户 jopen 自行上传分享,仅供网友学习交流。所有权归原作者,若您的权利被侵害,请联系管理员。
 转载本站原创文章,请注明出处,并保留原始链接、图片水印。
 本站是一个以用户分享为主的开源技术平台,欢迎各类分享!
 本文地址:https://www.open-open.com/lib/view/open1383612879727.html
RethinkDB NoSQL数据库