core-async

2025-07-01T09:42:54.757669Z

๐Ÿ˜ข 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 ๐Ÿงต

Jarrod Taylor (Clojure team) 2025-07-07T17:49:44.766999Z

@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.

Jarrod Taylor (Clojure team) 2025-07-07T17:50:07.634859Z

Let me know if that gets you unstuck.

2025-07-07T17:50:53.706119Z

Thanks @jarrodctaylor.. am afk at the mo, but I'll update you asap

๐Ÿ‘ 1
2025-07-07T19:02:09.502419Z

Thank @jarrodctaylor it's working (as per documentation ๐Ÿ™„)

Jarrod Taylor (Clojure team) 2025-07-07T19:15:49.531039Z

Good deal.

2025-07-01T09:43:07.481619Z

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

2025-07-01T09:43:32.994349Z

it's all somewhat compiled, I'm afraid ๐Ÿ˜•

Alex Miller (Clojure team) 2025-07-01T11:07:24.041409Z

@jarrodctaylor can you take a look?

Jarrod Taylor (Clojure team) 2025-07-01T11:09:59.703409Z

Are you able to share a reproduction @mightyfoo

2025-07-01T13:02:29.395129Z

Give me a mo, and I'll try and get a minimal example together.

2025-07-01T14:29:19.451389Z

{
 :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"

Jarrod Taylor (Clojure team) 2025-07-01T14:56:33.064929Z

Thanks. Give me a little bit of time to work through this and I will get back to you.

2025-07-01T15:00:04.339579Z

Thanks for looking at this @jarrodctaylor