Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 22 additions & 22 deletions docs/guide/clojure.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
encoding, transport, server identity and compatibility in Java, while exposing
captured persistent Clojure values and ordinary collection operations.

Start with the package [README](../../libtmux-clojure/README.md) for the
install boundary and one capture. This guide explains the choices that matter
after the first program: what is captured, what can perform I/O, who owns
workers and streams, and where model-facing MCP tooling begins.
Start with the [install and quick start](../../libtmux-clojure/README.md) for
the install boundary and one capture. This guide explains the choices that
matter after the first program: what is captured, what can perform I/O, who
owns workers and streams, and where model-facing MCP tooling begins.

The native API references list every documented public var in
[the core façade](clojure-api.md) and
Expand Down Expand Up @@ -134,16 +134,16 @@ submission does not add another tmux transport or alter the captured values.

<!-- clojure-snippet: fixture -->
```clojure
(require '[libtmux.async :as async]
(require '[libtmux.async :as tm-async]
'[libtmux.core :as tm])

(let [socket-path (java.nio.file.Path/of
(System/getProperty "libtmux.docs.socket")
(make-array String 0))]
(with-open [server (tm/open! {:socket-path socket-path})
runtime (async/runtime! {:max-running 3})]
runtime (tm-async/runtime! {:max-running 3})]
(tm/new-session! server {:name "docs-parallel"})
(let [tasks (mapv (fn [_] (async/submit! runtime #(tm/snapshot! server)))
(let [tasks (mapv (fn [_] (tm-async/submit! runtime #(tm/snapshot! server)))
(range 2))]
(mapv #(boolean (some (fn [session]
(= "docs-parallel" (:session/name session)))
Expand All @@ -158,22 +158,22 @@ started. Use a separate `:wait` task for operations that wait for a release.

<!-- clojure-snippet: fixture -->
```clojure
(require '[libtmux.async :as async]
(require '[libtmux.async :as tm-async]
'[libtmux.core :as tm])
(import '[java.time Duration])

(let [socket-path (java.nio.file.Path/of
(System/getProperty "libtmux.docs.socket")
(make-array String 0))]
(with-open [server (tm/open! {:socket-path socket-path})
runtime (async/runtime! {})]
runtime (tm-async/runtime! {})]
(let [started (promise)
task (async/submit! runtime {:kind :wait}
#(do (deliver started true)
(tm/await-channel! server "docs-cancel"
(Duration/ofSeconds 20))))]
task (tm-async/submit! runtime {:kind :wait}
#(do (deliver started true)
(tm/await-channel! server "docs-cancel"
(Duration/ofSeconds 20))))]
@started
(async/cancel! task)
(tm-async/cancel! task)
(try
@task
(catch clojure.lang.ExceptionInfo failure
Expand Down Expand Up @@ -369,7 +369,7 @@ explicitly when ownership requires it.

<!-- clojure-snippet: fixture -->
```clojure
(require '[libtmux.async :as async]
(require '[libtmux.async :as tm-async]
'[libtmux.core :as tm]
'[manifold.deferred :as deferred])
(import '[java.util.concurrent CompletionStage])
Expand All @@ -378,14 +378,14 @@ explicitly when ownership requires it.
(System/getProperty "libtmux.docs.socket")
(make-array String 0))]
(with-open [server (tm/open! {:socket-path socket-path})
runtime (async/runtime! {})]
runtime (tm-async/runtime! {})]
(tm/new-session! server {:name "docs-manifold"})
(let [task (async/submit! runtime #(tm/snapshot! server))
stage (async/then! runtime task
#(boolean (some (fn [session]
(= "docs-manifold"
(:session/name session)))
(:tmux/sessions %))))
(let [task (tm-async/submit! runtime #(tm/snapshot! server))
stage (tm-async/then! runtime task
#(boolean (some (fn [session]
(= "docs-manifold"
(:session/name session)))
(:tmux/sessions %))))
observed (deferred/->deferred stage)]
[(instance? CompletionStage stage) @observed])))
;; => [true true]
Expand Down
8 changes: 5 additions & 3 deletions libtmux-clojure-core-async/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ core.async dependency.

This adapter has not shipped. Its Maven coordinate is
`io.github.libtmux:libtmux-clojure-core-async`; there is no public release to
install yet. Build and verify it from this checkout:
install yet. To build and verify it from source, run this from the root of a
libtmux-java clone:

```console
$ ./gradlew :libtmux-clojure-core-async:check
Expand All @@ -47,8 +48,9 @@ The [complete core.async program][program] includes imports, a CLI entry point,
the optional dependency alias, private-server setup and cleanup. It closes its
events consumer, reads the terminal outcome, and reuses the borrowed connection.

The `javadoc` classifier contains native reference HTML and an offline source
browser, generated from this module's var metadata.
The `javadoc` classifier of the `libtmux-clojure-core-async` artifact contains
native reference HTML and an offline source browser, generated from the
adapter's var metadata.

[api]: ../docs/guide/clojure-core-async-api.md
[core-async]: https://clojure.github.io/core.async/clojure.core.async.html
Expand Down
18 changes: 10 additions & 8 deletions libtmux-clojure/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ leaves ordinary Clojure collection processing local and unconstrained.

The Clojure façade has not shipped. Its Maven coordinate is
`io.github.libtmux:libtmux-clojure`; there is no public release to install yet.
Build and verify it from this checkout:
To build and verify it from source, run this from the root of a
libtmux-java clone:

```console
$ ./gradlew :libtmux-clojure:check :integration-tests:clojureIntegrationTest
Expand Down Expand Up @@ -128,13 +129,14 @@ with the tmux version, endpoint choice, and the smallest reproducer.
run. It does not yet claim a façade-specific benchmark.
- [Changelog](CHANGELOG.md) — module-visible changes once this façade ships.

Every Clojure snippet in this README and the guide runs against an isolated
tmux server in `:integration-tests:clojureIntegrationTest`; no snippet is
illustrative pseudocode.
Every Clojure snippet on this page and in the [guide][guide] runs against an
isolated tmux server in `:integration-tests:clojureIntegrationTest`; no snippet
is illustrative pseudocode.

The module's `javadoc` classifier contains native Clojure reference HTML and
an offline source browser. Build it with `:libtmux-clojure:clojureApiJar`;
the generated site starts at `build/docs/clojure/index.html` in this module.
The `javadoc` classifier of the `libtmux-clojure` artifact contains native
Clojure reference HTML and an offline source browser. To build it from source,
run `:libtmux-clojure:clojureApiJar`; the generated site starts at
`libtmux-clojure/build/docs/clojure/index.html`.

[benchmarks]: ../benchmarks/README.md
[api]: ../docs/guide/clojure-api.md
Expand All @@ -145,7 +147,7 @@ the generated site starts at `build/docs/clojure/index.html` in this module.
[core-async]: ../libtmux-clojure-core-async/README.md
[data-api]: ../docs/guide/clojure-api.md#libtmuxdata
[guide]: ../docs/guide/clojure.md
[guide-streaming]: ../docs/guide/clojure.md
[guide-streaming]: ../docs/guide/clojure.md#lifecycle-streaming-and-optional-adapters
[java-core]: ../libtmux/README.md
[mcp-guide]: ../docs/guide/mcp.md
[programs]: ../examples/api/README.md#clojure-programs
Expand Down
Loading