Boston Clojure Meetup — core.async (July 2016)
Table of Contents
1. Topics
Topics to consider
- core.async
- spec
- transducers
- onyx
- reagent
- datascript
1.1. Background
Use of queue-like channels. CSP as foundation.
1.2. Demos
Show the demos associated that are generally shown with core.async.
1.3. Features
1.3.1. put and take
- Alts
- Combining
- buffer size will block when full until another take
| op | go | thread | (external) |
|---|---|---|---|
| put | (>! ch val) | (>!! ch val) | (put! ch val) |
| take | (<! ch) | (<!! ch) | (take ch) |
1.3.2. alts
(let [c1 (chan)
c2 (chan)]
(thread (while true
(let [[v ch] (alts!! [c1 c2])]
(println "Read" v "from" ch)))))
1.3.3. merge and split
(split p in-chan t-chan f-chan)
1.3.4. mult and tap
1.4. Examples
1.4.1. Diffie-Hellman Handshake
1.4.2. Cognitech core.async Webinar
1.4.3. Rate Throttle
Specify the rate of requests.
- unthrottled
- setTimeout
- _.throttle
- bucket