Currently the documentation for flow/process in clojure.core.async.flow says it can receive a fn or a map and that the only required arities/keys are the :describe(arity 0) and :transform(arity 3) but this optionality seems only to be working when providing maps...
clj -Sdeps '{:deps {org.clojure/core.async {:git/sha "d922995579ce50f0760cbfc781f1e4a6ea077ce1" :git/url ""}}}'
Clojure 1.12.0
user=> (require '[clojure.core.async.flow :as flow])
nil
user=> (flow/create-flow {:procs
{:my-proc (flow/process
(fn
([] {:outs {:nums ""}})
([_ _ _] [])))}})
Execution error (IllegalArgumentException) at clojure.core.async.flow.spi/eval9490$fn$G (spi.clj:11).
No implementation of method: :describe of protocol: #'clojure.core.async.flow.spi/ProcLauncher found for class: nil
it is confusing that the error says the describe isn't found while the zero arity is being provided
I’ll take a look at this today
great, the issue is still valid but my previous example is wrong, forgot the :proc keyword, this is the corrected one :
clj -Sdeps '{:deps {org.clojure/core.async {:git/sha "d922995579ce50f0760cbfc781f1e4a6ea077ce1" :git/url ""}}}'
Clojure 1.12.0
user=> (require '[clojure.core.async.flow :as flow])
nil
user=> (flow/start
(flow/create-flow {:procs
{:my-proc {:proc (flow/process
(fn
([] {:outs {:nums ""}})
([_ _ _] [nil []])))}}}))
Execution error (ArityException) at clojure.core.async.flow.impl$proc$reify__9924/start (impl.clj:258).
Wrong number of args (1) passed to: user/eval9998/fn--9999
so it looks like when you provide a fn it is calling all arities.I ran into this myself a couple days ago, hadn't gotten around to looking at it yet
you need all the arities 0...3
yeah, that works, but then it doesn't match the documentation