Skip to content

Commit 61e8d31

Browse files
committed
Update docs for tagged release
1 parent 1f21413 commit 61e8d31

File tree

3 files changed

+370
-314
lines changed

3 files changed

+370
-314
lines changed

README.md

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,46 @@ You can run multiple monitoring servers simultaneously to monitor different flow
8989
(monitor/stop-server server2)
9090
```
9191

92+
### Filtering Proc State
93+
94+
It is common for the state to contain credentials and other sensitive information not intended to be displayed in the monitor. Filter predicates can optionally be provided when starting the monitor to filter the state data of flow procs.
95+
96+
``` clojure
97+
;; Create a flow
98+
(def my-flow (flow/create-flow ...))
99+
100+
;; Start the monitoring server
101+
;;; In this example
102+
;;; The :categorize proc will have the :salary value removed
103+
;;; and :db-pass will be removed from all procs other than :categorize
104+
(def server-state (monitor/start-server {:flow my-flow
105+
:state-filters {:categorize (fn [[k v]] (not= :salary k))
106+
:default (fn [[k v]] (not= :db-pass k))}}))
107+
```
108+
109+
110+
### Circular Flows
111+
112+
It is valid to create a cyclical flow. The monitor displays procs without a `[to-pid inid]` at the top as roots. A circular flow will need to specify the intended root explicitly. A vector of :pid keywords can optionally be provided when starting the monitor to designate the root procs.
113+
114+
``` clojure
115+
116+
(def flow-config {:procs ...
117+
:conns [[[:a :out] [:b :in]]
118+
[[:b :out] [:a :in]]]})
119+
120+
;; Create a flow
121+
(def my-flow (flow/create-flow flow-config))
122+
123+
;; Start the monitoring server specifying the root proc(s)
124+
(def server-state (monitor/start-server {:flow my-flow
125+
;; Multiple roots can be provided if desired
126+
:root [:a]}))
127+
128+
;; Inline static flow graphs also require the root to be specified for circular flows
129+
(static/graph flow-config [:a])
130+
```
131+
92132
## Static Flow Graph
93133

94134
Both [Cursive](https://cursive-ide.com/blog/cursive-2025.1.html) and [Calva](https://calva.io/flares/) support displaying HTML in the editor. A static graph can be generated from your flow-config and displayed in either of those editor environments with the following:
@@ -99,9 +139,12 @@ Both [Cursive](https://cursive-ide.com/blog/cursive-2025.1.html) and [Calva](htt
99139
[clojure.core.async.flow :as flow])
100140

101141
;; Create a flow
102-
(def my-flow (flow/create-flow ...))
142+
(def flow-config {:procs ...
143+
:conns ...})
144+
145+
(graph flow-config) ; Takes a config not what is returned from create-flow
103146

104-
(graph my-flow)
147+
(def my-flow (flow/create-flow flow-config))
105148
```
106149

107150
## Contributing

0 commit comments

Comments
 (0)