2title = "Thread Documentation"
6grant_type = [ "Bounty" ]
7grant_category = [ "Documentation" ]
11description = "Document, explain, and give simple howtos for the usage patterns of threads in the Dojo and Gall agents."
13assignee = "~tinnus-napbus"
19# Thread Documentation Bounty
21The [official thread documentation](https://urbit.org/docs/tutorials/arvo/gall/#threads) is accurate and helpful, but it's a very thin combination of explainer (production code), how-to, and reference. It's a nice starting point, but it's not sufficient to let a typical Urbit autodidact enthusiast get fully comfortable with threads. As a result, they are often an uncomfortable/unused part of the Urbit system, even though they are useful and robust.
23Fortunately, the amount of implicit knowledge needed to build a strong mental model of threads and begin using them in Urbit applications. By expanding the explainer/tutorial/howto/reference and delineating them more clearly, we can expose this part of Urbit to devs.
25This bounty is detailed for clarity, but the individual sections shouldn't take too long to write and don't need to be extremely long.
30- `spider` usage in Gall
31- calling from the dojo with `-`
32- the `bind`/`;<` chaining model
33- how `spider` manages its threads
43- Walk through building a thread that composes multiple threads
44- Will be all from the Dojo using `-`, no Gall
45- Should include the following calls
47 - pass cards to Arvo/Gall
49 - read a file from Clay
53- use `lib/strand.hoon` code to explain `bind` and the `%wait` etc. objects
54- explain how all threads MUST take `strand-input` as an argument
55- explain how `spider` sends `strand-input` to threads and how it determines which threads to send to.
59- Call out to outside web services, chaining calls in the manner of promises/async in other languages
60- make system calls to Arvo
61- receive/handle responses from Arvo
62- use `spider` to integrate with Gall
63- use `retry` and `backoff` for calls that may fail
67This can be thin for now, because most necessary thread functions are in `lib/strandio.hoon`, and we don't need to just cut-and-paste that. Just make a quick list of functionality in `lib/strandio` or edit the one in the current thread docs
71- as a learner with Hoon knowledge, I will be able to build a mental model of how `spider` manages threads, sends input to them, and chains them together. `bind` and `;<` will be demystified and explained in very simple, mechanical ways.
72- as a Hoon learner with prior monad experience, I should be able to get a feel for the similarities of IO monads and Urbit threads, and develop strong intuitions for the more mechanical nature of Urbit ones.
73- as a moderately motivated autodidact with Hoon knowledge I should be able to start writing `ted` threads for Dojo usage immediately, with no other outside materials or informal help needed
74- as a Gall app developer or maintainer, I should be able to integrate threads into my Gall apps
78`~timluc-miptev` will be available to whomever does the bounty to explain things, work through any tough spots, and connect to useful people if necessary.
82### Complete the bounty
85Everything in "sections" is done.
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list