core-async

phronmophobic 2026-02-04T19:06:46.065359Z

Is there a way to wait for a flow to completely shut down? It doesn't seem like flow/stop waits for all procs to stop before returning. For context, I have some resources I want to free after a flow is stopped and I want to ensure that these resources are freed last, after all processes have stopped.

Alex Miller (Clojure team) 2026-02-04T19:32:43.970469Z

what kind of resources?

phronmophobic 2026-02-04T19:33:51.076799Z

This is for clj-media. This particular example is freeing native memory.

phronmophobic 2026-02-04T19:36:58.295909Z

If I free too early, I can get a segfault if some code tries to reference the freed memory. I can let the gc track the handles, but I haven't found a good way to make sure that the gc cleans up resources in a reasonable amount of time which leads to lots of memory bloat on the native heap.

phronmophobic 2026-02-04T19:42:32.922179Z

Right now, I have pools of packets/frames that get passed around and reused. At the end, I'd like to free all the packets/frames.

Alex Miller (Clojure team) 2026-02-04T19:43:46.156789Z

can you ping?

phronmophobic 2026-02-04T19:44:16.251469Z

I thought you couldn't ping after a flow has stopped.

phronmophobic 2026-02-04T19:45:04.835919Z

I guess I could pause, ping, then stop.

phronmophobic 2026-02-04T19:47:54.591459Z

Pinging a stopped flow throws an exception.

phronmophobic 2026-02-04T20:03:16.897839Z