<commit_before># eureka

A Clojure library that wraps the Curator service discovery/registration API and provides a set of idiomatic set of Clojure functions to register and discover services. Eureka also manages the lifecycle of the CuratorFramework internally, creating a connection to zookeeper instances as necessary and closing those connections when your application terminates.

## Usage

A typical **registration** example, a backend service registering a resource:

```clj
(ns heartbeat.setup
  (:require [eureka.registration :as eureka])

(defn register-public-resources []
  (eureka/connect!)
  (eureka/register! {:name "user-sessions"
                     :port (env :service-port)
                     :uri-spec "/1.x/{territory}/users/{userid}/sessions/{devicetype}/{app}"}))
```

A typical **discovery** example, _foo_ service finding an instance of _bar_ handle a request:

```clj
(ns foo.setup
  (:require [eureka.registration :as eureka])

(defn setup []
  ...
  (eureka/connect!))
```

```clj
(ns foo.bar
  (:require [eureka.registration :as eureka])

(defn fn-that-calls-bar [territory]<commit_msg>Fix port in README.md example<commit_after># eureka

A Clojure library that wraps the Curator service discovery/registration API and provides a set of idiomatic set of Clojure functions to register and discover services. Eureka also manages the lifecycle of the CuratorFramework internally, creating a connection to zookeeper instances as necessary and closing those connections when your application terminates.

## Usage

A typical **registration** example, a backend service registering a resource:

```clj
(ns heartbeat.setup
  (:require [eureka.registration :as eureka])

(defn register-public-resources []
  (eureka/connect!)
  (eureka/register! {:name "user-sessions"
                     :port (Integer. (env :service-port))
                     :uri-spec "/1.x/{territory}/users/{userid}/sessions/{devicetype}/{app}"}))
```

A typical **discovery** example, _foo_ service finding an instance of _bar_ handle a request:

```clj
(ns foo.setup
  (:require [eureka.registration :as eureka])

(defn setup []
  ...
  (eureka/connect!))
```

```clj
(ns foo.bar
  (:require [eureka.registration :as eureka])

(defn fn-that-calls-bar [territory]
{'fraction_non_alphanumeric': 0.11312417145382236, 'fraction_numerical': 0.0008837825894829872, 'mean_word_length': 4.122171945701357, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1806719', 'n_tokens_mistral': 720, 'n_tokens_neox': 661, 'n_words': 234}