Free from core.async
This commit is contained in:
parent
a99cac4285
commit
fb6e739aee
4 changed files with 8 additions and 12 deletions
|
|
@ -362,7 +362,8 @@ The callback `:success` is called with a map containing:
|
|||
|
||||
- `:value`: a return value from the pod var
|
||||
|
||||
The callback `:error` is called with a map containing:
|
||||
The callback `:error` is called in case the pod sends an error, a map
|
||||
containing:
|
||||
|
||||
- `:ex-message`: an error message
|
||||
- `:ex-data`: an arbitrary additional error data map. Typically it will contain
|
||||
|
|
@ -371,9 +372,9 @@ The callback `:error` is called with a map containing:
|
|||
If desired, `:ex-message` and `:ex-data` can be reified into a
|
||||
`java.lang.Exception` using `ex-info`.
|
||||
|
||||
The callback `:done` is called with one argument which is currently
|
||||
undefined. This callback can be used to determine if the pod is done sending
|
||||
values.
|
||||
The callback `:done` is called with one argument, a map. This callback can be
|
||||
used to determine if the pod is done sending values, in case it wants to send
|
||||
multiple. The callback is only called if no errors were sent by the pod.
|
||||
|
||||
In the above example the wrapper function calls the pod identified by
|
||||
`"pod.babashka.filewatcher"`. It calls the var
|
||||
|
|
|
|||
3
deps.edn
3
deps.edn
|
|
@ -1,6 +1,5 @@
|
|||
{:deps {nrepl/bencode {:mvn/version "1.1.0"}
|
||||
cheshire {:mvn/version "5.10.0"}
|
||||
org.clojure/core.async {:mvn/version "1.1.587"}}
|
||||
cheshire {:mvn/version "5.10.0"}}
|
||||
:aliases
|
||||
{:sci
|
||||
{:extra-deps
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
(:refer-clojure :exclude [read])
|
||||
(:require [bencode.core :as bencode]
|
||||
[cheshire.core :as cheshire]
|
||||
[clojure.core.async :as async]
|
||||
[clojure.edn :as edn]))
|
||||
|
||||
(set! *warn-on-reflection* true)
|
||||
|
|
@ -86,7 +85,7 @@
|
|||
(and error? error-handler)
|
||||
(error-handler {:ex-message ex-message
|
||||
:ex-data ex-data})))
|
||||
(when done?
|
||||
(when (and done? (not error?))
|
||||
(when promise?
|
||||
(deliver chan nil))
|
||||
(when done-handler
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
(ns babashka.pods.sci-test
|
||||
(:require [babashka.pods.sci :as pods]
|
||||
[babashka.pods.test-common :refer [test-program assertions]]
|
||||
[clojure.core.async :as async]
|
||||
[clojure.test :refer [deftest]]
|
||||
[sci.core :as sci]))
|
||||
|
||||
|
|
@ -14,7 +13,5 @@
|
|||
test-program
|
||||
{:namespaces {'babashka.pods
|
||||
{'load-pod pods/load-pod
|
||||
'invoke pods/invoke}
|
||||
'clojure.core.async
|
||||
{'<!! async/<!!}}}))]
|
||||
'invoke pods/invoke}}}))]
|
||||
(assertions out err ret)))
|
||||
|
|
|
|||
Loading…
Reference in a new issue