Skip to content

mount and celtuce #111

@cmal

Description

@cmal

redis.clj:

(ns proj.redis
  (:require
   [celtuce.connector :as conn]
   [taoensso.timbre :as log]
   [mount.core :as mount]
   [proj.global :as g]))

(mount/defstate redis-client
  :start (let [port (get-in @g/config [:port :redis])
               connector (conn/redis-server (str "redis://localhost:" port))]
           (log/info (str "redis connection established on port: " port "."))
           connector)
  :stop (do
          (conn/shutdown redis-client)
          (log/info "redis connection closed.")))

(def cmds
  (conn/commands-sync redis-client))

$ lein uberjar

java.lang.IllegalArgumentException: No implementation of method: :commands-sync of protocol: #'celtuce.connector/RedisConnector found for class: mount.core.DerefableState, compiling:(redis.clj:24:3)
Exception in thread "main" java.lang.IllegalArgumentException: No implementation of method: :commands-sync of protocol: #'celtuce.connector/RedisConnector found for class: mount.core.DerefableState, compiling:(redis.clj:24:3)

It seems syntax checking not passed when compiling.

image

I also found redis-client is a celtuce.connector.RedisServer, and (def cmds (conn/commands-sync redis-client)) can be run in repl, but cannot be compiled.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions