core-async

dehli 2019-02-12T21:41:52.001900Z

Has anyone run into this issue before? https://dev.clojure.org/jira/browse/ASYNC-110 I have a top-level go block which seems to be causing the issue and I would like to keep it top level but I'm not sure how to address the problem

2019-02-12T21:47:38.003300Z

I understand this is cljs and different rules apply, but my prejudice coming from clj is to not allocate stateful resources in top level code, even something as trivial as wrapping it in a delay that gets forced via -main is an improvement over top level side effects

2019-02-12T21:50:04.004600Z

or a declare at the top level, and an assignment to the declared var via set! in -main

dehli 2019-02-12T21:52:45.005700Z

thanks! that makes sense to me. i'm writing this for an aws lambda function and if you execute code on load of the script you get performance benefits which is why I want it top-level.

dehli 2019-02-12T21:53:34.006500Z

sticking it in -main would work, however the way the project is currently setup has only one -main to speed up build times 🙂

2019-02-12T21:54:44.007400Z

oh, with multiple possible execution paths decided on startup, right, I can see the advantage of that

dehli 2019-02-12T21:57:40.008600Z

ya! it's working well so far. I could always switch to native javascript promises for this setup but hopefully there's a workaround!