Can a ClojureScript implementation use core.async in Clojure?

Is it possible to use ClojureScript for end machines based on the core.async core in Clojure and not in a Clojure streaming implementation? I would like to be able to use core.async in the JVM, but without using threads.

+4
source share
2 answers

This is currently not possible, but nothing prevents you from modifying core.async to support a single-threaded model. All dispatching is handled via clojure.core.async.impl.dispatch/runChange this function to use some other dispatch method, and everything should work. The core.async version for ClojureScript has a different version dispatch/runthat uses setTimeout (or other things that might be faster). Copy this code and modify it to work on your virtual machine, and it should not be difficult.

+3
source

core.async JVM , threadpool, go , .

, edbond , Clojure core.async go s. , + 42, go .

JVM core.async thread, go, , (<!!, >!! ..), , . , ; go , core.async - threadpool.

+7

Source: https://habr.com/ru/post/1526516/


All Articles