on master help sign in
gall-guide: subscriptions - apply poprox suggestions

Co-authored-by: poprox <51337059+drbeefsupreme@users.noreply.github.com>

commit5f5f32335ce4d52906c2c39dfb9be4358cf934ae authortinnus-napbus <77721746+tinnus-napbus@users.noreply.github.com> dateFri 26 Nov 2021, 18:44 (5 years ago) parente25c0c6
1 file changed+7−5
content/docs/userspace/gall-guide/8-subscriptions.md+7−5
content/docs/userspace/gall-guide/8-subscriptions.md+7−5
@@ -163,7 +163,7 @@ it: Subscribing to other agents. This is done by `%pass`ing the target agent a
163163[%pass /some/wire %agent [~some-ship %some-agent] %watch /some/path]
164164```
165165
166−If yor agent's subscription request is successful, updates will come in to your
166+If your agent's subscription request is successful, updates will come in to your
167167agent's `on-agent` arm on the `wire` specified (`/some/wire` in this example).
168168The `wire` can be anything you like - its purpose is for your agent to figure
169169out which subscription the updates are for. The `[ship term]` pair specifies the
@@ -228,7 +228,7 @@ an error message fed into the `on-fail` arm of your agent.
228228## Receiving updates
229229
230230Assuming the `%watch` succeeded, your agent will now begin receiving any
231−`%fact`s the other agent publishes on the path to which you've subscribed. These
231+`%fact`s the other agent publishes on the `path` to which you've subscribed. These
232232`%fact`s will also come in to your agent's `on-agent` arm in a `sign`, just like
233233the initial `%watch-ack`. The `%fact` `sign` will have the following format:
234234
@@ -238,7 +238,7 @@ the initial `%watch-ack`. The `%fact` `sign` will have the following format:
238238
239239You would typically handle such `%fact`s in the following manner: Test the
240240`wire`, test whether the `sign` is a `%fact`, test the `mark` in the `cage`,
241−extract the data from the `vase` in the `cage`, and apply your logic. For example:
241+extract the data from the `vase` in the `cage`, and apply your logic. Again, route on `wire` before `sign` is one of the [Precepts](/docs/development/precepts#specifics). For example:
242242
243243```hoon
244244++ on-agent
@@ -263,7 +263,7 @@ The `on-agent` arm produces a `(quip card _this)`, so you can produce new
263263
264264## Getting kicked
265265
266−For whatever reason, the agent you're `%watch`ing might what to kick your agent
266+For whatever reason, the agent you're `%watch`ing might want to kick your agent
267267from a `path` to which it's suscribed, ending your subscription and ceasing to
268268send your agent `%fact`s. To do this, it will send your agent a `%kick` card [as
269269described above](#kicking-subscribers). The `%kick` will come in to your agent's
@@ -538,6 +538,8 @@ currently exists, getting the new subscriber up to date.
538538
539539### Subscriber
540540
541+#### `/app/todo-watcher.hoon`
542+
541543```hoon
542544/- todo
543545/+ default-agent, dbug
@@ -620,7 +622,7 @@ currently exists, getting the new subscriber up to date.
620622```
621623
622624This is the subscriber agent. Since it's just for demonstrative purposes, it has
623−no state and just prints updates it receives. In practice it would keep the
625+no state and just prints the updates it receives. In practice it would keep the
624626`tasks` map it receives in its own state, and then update it as it receives new
625627`%fact`s.
626628