- Notifications
You must be signed in to change notification settings - Fork4
Unleash Client SDK for Clojure
License
NotificationsYou must be signed in to change notification settings
AppsFlyer/unleash-client-clojure
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
A Clojure library wrappingunleash java client
(require '[unleash-client-clojure.unleash:as u] '[unleash-client-clojure.builder:as b]);; a simple client(defunleash (u/build (b/app-name"app-name") (b/unleash-api"http://unleash.herokuapp.com/api/")));; simple toggle(u/enabled? unleash"Bit");; toggle with context(require '[unleash-client-clojure.context:as c])(defuser-context (c/build (c/user-id"user-id")))(u/enabled? unleash"toggle-name" user-contextfalse);; more configuration can be passed by using the functions in the builder namespace(require '[unleash-client-clojure.builder:as b])(defunleash (u/build"app-name""instance-id""http://unleash.herokuapp.com/api/" (b/environment"staging") (b/fetch-toggles-interval15)))
(require '[unleash-client-clojure.variant:as v])(u/get-variant unleash"DemoVariantWithPayload")(let [x (u/get-variant unleash"DemoVariantWithPayload")] [(v/get-name x) (v/get-type x) (v/variant-enabled? x) (v/get-value x)])
;; the builder namespace supports passing builder confgurations as functions(require '[unleash-client-clojure.builder:as b])(defunleash (u/build (b/app-name"app-name") (b/unleash-api"http://unleash.herokuapp.com/api/") (b/environment"staging") (b/fetch-toggles-interval1)));; see the builder namespace for more available options
;; one a subscriber can be pased to the client builder by passing(b/subscriber my-subscriber);; the subscriber namespace has functions to help you build a subsriber(require '[unleash-client-clojure.subscriber:as s]);; pass a map with the keys [:on-error :on-event :toggle-evaluated;; :toggles-fetched :client-metrics :client-registered :toggles-backed-up;; :toggle-backup-restored] and callbacks you want to register.;; any missing key defaults to no-op;; this is a very noisy example:(defunleash (u/build (b/app-name"app-name") (b/unleash-api"http://unleash.herokuapp.com/api/") (b/subscriber (s/build {:on-event println})))
- Integration testing
About
Unleash Client SDK for Clojure
Resources
License
Code of conduct
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
No packages published
Contributors3
Uh oh!
There was an error while loading.Please reload this page.