Liking cljdoc? Tell your friends :D

hive-hot.events

Event emission for hive-hot integration with hive-events.

Event schemas:

  • [:file/changed {:file "src/foo.clj" :type :modify|:create|:delete}]
  • [:hot/reload-start {}]
  • [:hot/reload-success {:loaded [ns...] :unloaded [ns...] :ms N}]
  • [:hot/reload-error {:failed ns :error "message"}]

Events are dispatched via hive.events/dispatch for system-wide observability and coordination.

Event emission for hive-hot integration with hive-events.

Event schemas:
- [:file/changed {:file "src/foo.clj" :type :modify|:create|:delete}]
- [:hot/reload-start {}]
- [:hot/reload-success {:loaded [ns...] :unloaded [ns...] :ms N}]
- [:hot/reload-error {:failed ns :error "message"}]

Events are dispatched via hive.events/dispatch for system-wide
observability and coordination.
raw docstring

emit!clj

(emit! [event-type data])

Emit an event via hive-events dispatch.

Automatically adds :timestamp to event data.

Example:

(emit! [:hot/reload-start {}])
Emit an event via hive-events dispatch.

Automatically adds :timestamp to event data.

Example:
```clojure
(emit! [:hot/reload-start {}])
```
sourceraw docstring

emit-file-changed!clj

(emit-file-changed! file change-type)

Emit a :file/changed event.

Args:

  • file: Path to the changed file (string)
  • change-type: One of :modify, :create, :delete

Example:

(emit-file-changed! "src/my/ns.clj" :modify)
Emit a :file/changed event.

Args:
- file: Path to the changed file (string)
- change-type: One of :modify, :create, :delete

Example:
```clojure
(emit-file-changed! "src/my/ns.clj" :modify)
```
sourceraw docstring

emit-reload-error!clj

(emit-reload-error! failed-ns error)

Emit a :hot/reload-error event.

Args:

  • failed-ns: The namespace symbol that failed to load
  • error: Error message or exception

Example:

(emit-reload-error! 'my.broken.ns "Syntax error on line 42")
Emit a :hot/reload-error event.

Args:
- failed-ns: The namespace symbol that failed to load
- error: Error message or exception

Example:
```clojure
(emit-reload-error! 'my.broken.ns "Syntax error on line 42")
```
sourceraw docstring

emit-reload-start!clj

(emit-reload-start!)

Emit a :hot/reload-start event.

Called at the beginning of a reload operation.

Emit a :hot/reload-start event.

Called at the beginning of a reload operation.
sourceraw docstring

emit-reload-success!clj

(emit-reload-success! loaded unloaded ms)

Emit a :hot/reload-success event.

Args:

  • loaded: Sequence of namespace symbols that were loaded
  • unloaded: Sequence of namespace symbols that were unloaded
  • ms: Elapsed time in milliseconds

Example:

(emit-reload-success! ['my.ns 'my.other] ['my.ns] 42)
Emit a :hot/reload-success event.

Args:
- loaded: Sequence of namespace symbols that were loaded
- unloaded: Sequence of namespace symbols that were unloaded
- ms: Elapsed time in milliseconds

Example:
```clojure
(emit-reload-success! ['my.ns 'my.other] ['my.ns] 42)
```
sourceraw docstring

make-claim-checkerclj

(make-claim-checker query-fn)

Create a claim-checker function that queries the logic module.

The returned function takes no arguments and returns a set of currently claimed file paths.

Args:

  • query-fn: A function that returns a sequence of claim maps with :file keys (e.g., hive-mcp's logic/get-all-claims)

Example:

;; In hive-mcp, inject the actual query function:
(def claim-checker
  (make-claim-checker logic/get-all-claims))

;; The debouncer uses it like:
(let [claimed-files (claim-checker)]
  (if (contains? claimed-files "src/foo.clj")
    :buffer
    :proceed))
Create a claim-checker function that queries the logic module.

The returned function takes no arguments and returns a set of
currently claimed file paths.

Args:
- query-fn: A function that returns a sequence of claim maps
            with :file keys (e.g., hive-mcp's logic/get-all-claims)

Example:
```clojure
;; In hive-mcp, inject the actual query function:
(def claim-checker
  (make-claim-checker logic/get-all-claims))

;; The debouncer uses it like:
(let [claimed-files (claim-checker)]
  (if (contains? claimed-files "src/foo.clj")
    :buffer
    :proceed))
```
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close