๐ข I can't seem to get flow-monitor to work on my web browser (chrome or firefox). Can anyone suggest what might be going wrong? Console output/stack trace in ๐งต
@mightyfoo You were on the right path and correctly identified where the issue was. Circular flows are valid, but flow monitor needs you to specify a root so it knows how to render the diagram. The readme has an example of https://github.com/clojure/core.async.flow-monitor?tab=readme-ov-file#circular-flows once I specified a root it successfully rendered for me.
Let me know if that gets you unstuck.
Thank @jarrodctaylor it's working (as per documentation ๐)
Good deal.
Websocket connection established with:
leader-line.min.js:2 Uncaught Error: `start` and `end` are required.
at Ze (leader-line.min.js:2:52054)
at Ye.setOptions (leader-line.min.js:2:72705)
at new Ye (leader-line.min.js:2:61055)
at main.js:1297:150
at main.js:1298:231
at ah (main.js:443:55)
at g.aa (main.js:445:309)
at I (main.js:364:83)
at bl (main.js:739:304)
at uK (main.js:1293:490)
Ze @ leader-line.min.js:2
Ye.setOptions @ leader-line.min.js:2
Ye @ leader-line.min.js:2
(anonymous) @ main.js:1297
(anonymous) @ main.js:1298
ah @ main.js:443
g.aa @ main.js:445
I @ main.js:364
bl @ main.js:739
uK @ main.js:1293
(anonymous) @ main.js:1600
setTimeout
(anonymous) @ main.js:1600
M @ main.js:30
Da @ main.js:31
R @ main.js:31
qa @ main.js:31
Ci @ main.js:51
xe @ main.js:50
od @ main.js:51
og @ main.js:54
cg @ main.js:255
Ya @ main.js:36
Ce @ main.js:61
rd @ main.js:60
u.unstable_runWithPriority @ main.js:26
Db @ main.js:80
ra @ main.js:255
Ki @ main.js:60 it's all somewhat compiled, I'm afraid ๐
@jarrodctaylor can you take a look?
Are you able to share a reproduction @mightyfoo
Give me a mo, and I'll try and get a minimal example together.
{
:paths ["src"]
:deps {
org.clojure/clojure {:mvn/version "1.12.0"}
org.clojure/core.async {:mvn/version "1.9.808-alpha1"}
io.github.clojure/core.async.flow-monitor {:git/tag "v0.1.2" :git/sha "6248a5d"}
}
}
(ns flow-monitor-test.flow
(:require
[clojure.core.async.flow :as flow]
[clojure.core.async.flow-monitor :as mon]))
(defn controller-process
([] {
:ins {:controller-input "input to controller"}
:outs {:to-server "channel to talk to server"}
})
([arg-map] {})
([state transition] state)
([state input msg] state))
(defn server-process
([] {
:ins {:server-input "input to controller"}
:outs {:to-controller "channel to talk to controller"}
})
([arg-map] {})
([state transition] state)
([state input msg] state))
(defn the-flow-def [broken?]
{
:procs {
:controller {:proc (flow/process #'controller-process)}
:server {:proc (flow/process #'server-process)}
}
:conns (if broken? [[[:controller :to-server] [:server :server-input]]
[[:server :to-controller] [:controller :controller-input]]] ; <- I think it's this cycle
[[[:controller :to-server] [:server :server-input]]])
})
(defn run-flow-and-monitor [{:keys [broken?] :or {broken? true}}]
(let [the-flow (flow/create-flow (the-flow-def broken?))]
(flow/start the-flow)
(mon/start-server {:flow the-flow})))
Reproduce:
clj -Srepro -X flow-monitor-test.flow/run-flow-and-monitor :broken? true
โข follow link
โข open browser console before clicking "Flow Connect"
โข (probably implicit in previous step) click "Flow Connect"Thanks. Give me a little bit of time to work through this and I will get back to you.
Thanks for looking at this @jarrodctaylor