- commit
- fdadd78
- parent
- 85bbfc5
- author
- Eric Bower
- date
- 2024-09-08 15:50:19 +0000 UTC
docs(pubsub): web copy
1 files changed,
+15,
-7
+15,
-7
1@@ -1,6 +1,6 @@
2 {{template "base" .}}
3
4-{{define "title"}}{{.Site.Domain}} -- pubsub using ssh{{end}}
5+{{define "title"}}pubsub using ssh{{end}}
6
7 {{define "meta"}}
8 <meta name="description" content="pubsub using ssh" />
9@@ -39,8 +39,8 @@
10 user-defined channels. Channels are private to the authenticated
11 ssh user. The default pubsub model is multicast with bidirectional
12 blocking, meaning a publisher (<code>pub</code>) will send its message to all
13- subscribers (<code>sub</code>). Further, both <code>pub</code> and
14- <code>sub</code> will wait for at least one event to be sent or received.
15+ subscribers (<code>sub</code>) on a channel. Further, both <code>pub</code> and
16+ <code>sub</code> will wait for at least one event to be sent or received on the channel.
17 </p>
18
19 <div>
20@@ -51,21 +51,29 @@
21
22 <div>
23 <h2 class="text-xl">Simple desktop notifications</h2>
24- <pre>ssh {{.Site.Domain}} sub notify | notify-send</pre>
25- <pre>./longjob.sh; echo "Job done!" | ssh {{.Site.Domain}} pub notify</pre>
26+ <pre>ssh {{.Site.Domain}} sub notify | notify-send "job done!"</pre>
27+ <pre>./longjob.sh; ssh {{.Site.Domain}} pub notify -e</pre>
28 </div>
29
30 <div>
31 <h2 class="text-xl">Simple CI/CD</h2>
32 <pre>ssh {{.Site.Domain}} sub myimg | docker pull myimg && docker up -d dev</pre>
33- <pre>docker buildx build --push -t myimg .; ssh {{.Site.Domain}} pub myimg</pre>
34+ <pre>docker buildx build --push -t myimg .; ssh {{.Site.Domain}} pub myimg -e</pre>
35+ </div>
36+
37+ <div>
38+ <h2 class="text-xl">Send a public message</h2>
39+ <pre>echo "hello world!" | ssh send.pico.sh pub mychan -p</pre>
40+ <p>Now anyone with a <code>pico</code> can subscribe to this channel:</p>
41+ <pre>ssh send.pico.sh sub mychan -p</pre>
42 </div>
43
44 <div>
45 <h2 class="text-xl">Caveats</h2>
46 <p>
47 You must always pipe something into <code>pub</code> or else it will block
48- indefinitely until the process is killed.
49+ indefinitely until the process is killed. However, you can provide a
50+ flag to send an empty message: <code>pub xyz -e</code>.
51 </p>
52 </div>
53