(!> & body)
Asynchronous version of !>. Returns a channel containing a railway result.
Asynchronous version of !>. Returns a channel containing a railway result.
(<|> ch alternative)
Asynchronous version of <|>. Try alternative on failure for async operations. Both value and alternative should be channels containing railway results.
Example: (<|> (go (failure "error")) (go (success 42))) => channel containing (success 42)
Asynchronous version of <|>. Try alternative on failure for async operations. Both value and alternative should be channels containing railway results. Example: (<|> (go (failure "error")) (go (success 42))) => channel containing (success 42)
(>-< ch success-fn failure-fn)
Asynchronous version of >-<. Branch processing based on success/failure for async operations. Both success-fn and failure-fn should return channels.
Example: (>-< (go (success 42)) #(go (str "Success: " %)) #(go (str "Error: " %))) => channel containing "Success: 42"
Asynchronous version of >-<. Branch processing based on success/failure for async operations. Both success-fn and failure-fn should return channels. Example: (>-< (go (success 42)) #(go (str "Success: " %)) #(go (str "Error: " %))) => channel containing "Success: 42"
(attempt f error-handler)
Asynchronous version of attempt. Creates a function that returns a channel and catches exceptions.
Asynchronous version of attempt. Creates a function that returns a channel and catches exceptions.
(either pred then else)
Asynchronous version of either. Both then and else functions should return channels.
Asynchronous version of either. Both then and else functions should return channels.
(guard pred error-msg)
Asynchronous version of guard. Returns a function that returns a channel containing a railway result.
Asynchronous version of guard. Returns a function that returns a channel containing a railway result.
(unwrap-channel ch)
Takes a channel containing a railway result and returns a channel that will contain the unwrapped value or error.
Takes a channel containing a railway result and returns a channel that will contain the unwrapped value or error.
(validate spec value)
Asynchronous version of validate. Returns a channel containing a railway result.
Asynchronous version of validate. Returns a channel containing a railway result.
(|+ & fs)
Asynchronous version of |+. Chains multiple async functions in a railway pattern. Each function should return a channel containing a railway result.
Example: (def workflow (|+a validate-user-async check-permissions-async save-user-async)) (workflow user-data) => channel containing Success or Failure
Asynchronous version of |+. Chains multiple async functions in a railway pattern. Each function should return a channel containing a railway result. Example: (def workflow (|+a validate-user-async check-permissions-async save-user-async)) (workflow user-data) => channel containing Success or Failure
(|-| ch & fns)
Asynchronous version of |-|. Threads a railway error through async functions. Each function should return a channel containing a railway result.
Example: (|-| (go (failure {:msg "Error"})) #(go (failure (assoc % :timestamp "now")))) => channel containing updated failure
Asynchronous version of |-|. Threads a railway error through async functions. Each function should return a channel containing a railway result. Example: (|-| (go (failure {:msg "Error"})) #(go (failure (assoc % :timestamp "now")))) => channel containing updated failure
(|> ch & fns)
Asynchronous version of |>. Threads a railway result through async functions. Each function should return a channel containing a railway result.
Example: (|> (go (success 5)) #(go (success (inc %))) #(go (success (double %)))) => channel containing (success 12)
Asynchronous version of |>. Threads a railway result through async functions. Each function should return a channel containing a railway result. Example: (|> (go (success 5)) #(go (success (inc %))) #(go (success (double %)))) => channel containing (success 12)
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close