revise是RethikDB的Clojure客户端开发包。特点是:异步、无锁、高效以及易用。
示例代码:
(require'[bitemyapp.revise.coectio:refer[coectclose]])(require'[bitemyapp.revise.query:asr])(require'[bitemyapp.revise.core:refer[ru]]);;coectretursthecoectioaget(let[local-co(coect);;defaultstolocalhost;;passicoectiooptiosmaptospecifybeyodthedefaultsremote-co(coect{:host"99.99.99.1":port28015:auth-key""});;ruigaqueryagaistacoectioretursapromise,theAPI;;aduderlyigimplemetatioareasychroous.respose(->(r/db"test")(r/table-create-db"authors")(rulocal-co))];;dereferecethepromisetoblockoit.(pritl@respose);;Wearedoeusigthecoectio(closelocal-co))
评论