Liking cljdoc? Tell your friends :D

procedure.async


cancel-proclj

(cancel-pro pro-name)
source

create-async-flowcljmacro

(create-async-flow pro-name)
source

dependenciesclj

(dependencies id)
source

dependentsclj

(dependents id)
source

depsclj

source

dispatchclj

(dispatch pro-name payload)

Dispatches socket, req and data to procedure. (dispatch ::get-employee-list-by-company {:req req :socket socket :data "Company A" :send-fn (fn [socket result] (s/put! socket result))})

Dispatches socket, req and data to procedure.
(dispatch ::get-employee-list-by-company {:req req
                                          :socket socket
                                          :data "Company A"
                                          :send-fn (fn [socket result]
                                                    (s/put! socket result))})
sourceraw docstring

dispatch-syncclj

(dispatch-sync pro-name payload)

Sync version of dispatch function that returns a response. It's a blocking operation. It should be used inside reg-pros (when there is a need for calling other reg-pros with different params).

Sync version of dispatch function that returns a response. It's a blocking operation.
It should be used inside reg-pros (when there is a need for calling other reg-pros with different params).
sourceraw docstring

merge-kwclj

(merge-kw k)
source

procedure-mapclj

source

reg-procljmacro

(reg-pro name-kw doc-string? deps? data-&-response-schema-map? body)

Defines a procedure with any doc-string or deps added to the procedure map. data-&-response-schema-map? defines a map with optional keys :data and :response that contain data or response schema.

e.g.; (reg-pro :current-user (fn [{:keys [req]}] (println "Request: " req) {:user (get-user-by-username (-> req :query-params (get "username")))}))

(reg-pro :get-current-users-favorite-songs [:current-user] {:data [:map [:category string?]] :response [:map [:songs (vector string?)]]} (fn [current-user {:keys [req data]}] (let [user-id (-> current-user :user :id) music-category (:category data)] {:songs (get-favorite-songs-by-user-id-and-music-category user-id music-category)})))

Defines a procedure with any doc-string or deps added to the procedure map.
 data-&-response-schema-map? defines a map with optional keys :data and :response that contain data or response schema.

 e.g.;
 (reg-pro
  :current-user
  (fn [{:keys [req]}]
   (println "Request: " req)
   {:user (get-user-by-username (-> req :query-params (get "username")))}))

(reg-pro
 :get-current-users-favorite-songs
 [:current-user]
 {:data [:map [:category string?]]
  :response [:map [:songs (vector string?)]]}
 (fn [current-user {:keys [req data]}]
   (let [user-id (-> current-user :user :id)
         music-category (:category data)]
     {:songs (get-favorite-songs-by-user-id-and-music-category user-id music-category)})))
sourceraw docstring

register-validation-fn!clj

(register-validation-fn! f)

Validation function (optional) can only return true, false and a string. If it returns string which indicates validation failed with an error message.

(register-validation-fn! (fn [schema data] (or (malli/validate schema data) (malli/humanize (malli/explain schema data)))))

Validation function (optional) can only return true, false and a string.
 If it returns string which indicates validation failed with an error message.

(register-validation-fn!
  (fn [schema data]
    (or (malli/validate schema data)
        (malli/humanize (malli/explain schema data)))))
sourceraw docstring

validate-if-existscljmacro

(validate-if-exists pro-name s param result)
source

validation-fnclj

source

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close