on master help sign in
subscriptions in gall fix
daf8cd6joshuareagan
docs/tutorials/gall/subscriptions.udon+5−5
@@ -35,10 +35,10 @@ Let's take a look at two apps, `:source` and `:sink`. First,
35|_ [bow=bowl:gall $~]
35|_ [bow=bowl:gall $~]
36::
36::
37++ poke-noun
37++ poke-noun
38− |= non=*
38+ |= non=*
39 ^- [(list move) _+>.$]
39 ^- [(list move) _+>.$]
40 :_ +>.$
40 :_ +>.$
41− %+ turn (prey /example-path bow)
41+ %+ turn (prey:pubsub:userlib /example-path bow)
42 |=([o=bone *] [o %diff %noun non])
42 |=([o=bone *] [o %diff %noun non])
43::
43::
44++ peer-example-path
44++ peer-example-path
@@ -140,7 +140,7 @@ And secondly, `:sink`:
140--
140--
141```
141```
142
142
143−Save this as `sink.hoon` in the `/app` directory of your urbit's pier.
143+Save this as `sink.hoon` in the `/app` directory of your urbit's pier (make sure both `source` and `sink` are on the same ship).
144
144
145Two notes:
145Two notes:
146
146
@@ -231,12 +231,12 @@ languages call "map" -- it runs a function on every item in a list and collects
231the results in a list. The list is `(prey /example-path bow)` and the function
231the results in a list. The list is `(prey /example-path bow)` and the function
232is the `|=` line right after it.
232is the `|=` line right after it.
233
233
234−`++prey` is a standard library function defined in `zuse.hoon`. It takes a path
234+`prey:pubsub:userlib` is a standard library function defined in `zuse.hoon`. It takes a path
235and a bowl and gives you a list of the subscribers who are subscribed on a path
235and a bowl and gives you a list of the subscribers who are subscribed on a path
236that begins with the given path. "Prey" is short for "prefix".
236that begins with the given path. "Prey" is short for "prefix".
237
237
238Now we have the list of relevant subscribers. This a list of triples,
238Now we have the list of relevant subscribers. This a list of triples,
239−`{bone @p path}`, where the only thing we really need is the bone, because we
239+`[bone @p path]`, where the only thing we really need is the bone, because we
240don't need to know their urbit or what exact path they subscribed on. Thus, our
240don't need to know their urbit or what exact path they subscribed on. Thus, our
241transformer function takes `[o=bone *]` and produces `[o %diff %noun non]`,
241transformer function takes `[o=bone *]` and produces `[o %diff %noun non]`,
242which is a move that provides bone `o` with this subscription update:
242which is a move that provides bone `o` with this subscription update: