Async docs
This commit is contained in:
parent
24a469af65
commit
1a5100ad32
1 changed files with 10 additions and 6 deletions
16
README.md
16
README.md
|
|
@ -186,8 +186,7 @@ enumerated explicitly.
|
||||||
`make-parents`, `output-stream`, `reader`, `resource`, `writer`
|
`make-parents`, `output-stream`, `reader`, `resource`, `writer`
|
||||||
- `clojure.main`: `repl`
|
- `clojure.main`: `repl`
|
||||||
- [`clojure.core.async`](https://clojure.github.io/core.async/) aliased as
|
- [`clojure.core.async`](https://clojure.github.io/core.async/) aliased as
|
||||||
`async`. The `alt` and `go` macros are not available but `alts!!` does work as
|
`async`.
|
||||||
it is a function.
|
|
||||||
- `clojure.stacktrace`
|
- `clojure.stacktrace`
|
||||||
- `clojure.test`
|
- `clojure.test`
|
||||||
- `clojure.pprint`: `pprint` (currently backed by [fipp](https://github.com/brandonbloom/fipp)'s `fipp.edn/pprint`)
|
- `clojure.pprint`: `pprint` (currently backed by [fipp](https://github.com/brandonbloom/fipp)'s `fipp.edn/pprint`)
|
||||||
|
|
@ -606,10 +605,10 @@ Also see this [example](examples/process_builder.clj).
|
||||||
|
|
||||||
## Async
|
## Async
|
||||||
|
|
||||||
Apart from `future` and `pmap` for creating threads, you may use the `async`
|
Apart from `future` and `pmap` for creating threads, you may use the
|
||||||
namespace, which maps to `clojure.core.async`, for asynchronous scripting. The
|
`clojure.core.async` namespace, aliases as `async`, for asynchronous
|
||||||
following example shows how to get first available value from two different
|
scripting. The following example shows how to get first available value from two
|
||||||
processes:
|
different processes:
|
||||||
|
|
||||||
``` clojure
|
``` clojure
|
||||||
bb '
|
bb '
|
||||||
|
|
@ -622,6 +621,11 @@ bb '
|
||||||
process 2
|
process 2
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Note: the `go` macro is available for compatibility with JVM programs, but the
|
||||||
|
implementation maps to `clojure.core.async/thread` and the single exclamation
|
||||||
|
mark operations (`<!`, `>!`, etc.) map to with the double exclamation mark
|
||||||
|
operations (`<!!`, `>!!`, etc.). It will not `park` threads, like on the JVM.
|
||||||
|
|
||||||
## HTTP
|
## HTTP
|
||||||
|
|
||||||
For making HTTP requests you can use:
|
For making HTTP requests you can use:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue