7That's basically all you need to know to write threads. The best way to get a good handle on them is just to experiment with some `strandio` functions. For information on running threads from gall agents, see [here](/docs/userspace/threads/gall) and for some examples see [here](/docs/userspace/threads/examples).
9Now here's a quick recap of the main points covered:
13- is the gall agent that manages threads.
14- Details of interacting with threads via spider can be seen [here](/docs/userspace/threads/reference).
18- are like transient gall agents
19- are used mostly to chain a series of IO operations
20- can be used by gall agents to spin out IO operations
21- live in the `ted` directory
22- are managed by the gall agent `spider`
23- take a `vase` and produce a `strand` which produces a `vase`
29=, strand=strand:spider
39- are the building blocks of threads
40- take [this](https://github.com/urbit/urbit/blob/master/pkg/arvo/lib/strand.hoon#L2-L21) input and produce [this](https://github.com/urbit/urbit/blob/master/pkg/arvo/lib/strand.hoon#L23-L48) output.
41- must be specialised to produce a particular type like `(strand ,@ud)`.
42- are conventionally given the face `m`.
43- are a core that has three main arms - `form`, `pure` and `bind`:
47- is the mold of the strand suitable for casting
48- is the type returned by the other arms
52- simply returns the `form` of a `strand` that produces pure's argument without doing any IO
56- is used to chain strands together like javascript promises
57- is used in conjunction with micgal (`;<`)
58- must be specialised to a type like `;< <type> bind:m ...`
59- takes two arguments. The first is a function that returns the `form` of a `strand` that produces `<type>`. The second is a gate whose sample is `<type>` and which returns a `form`.
60- calls the first and then, if it succeeded, calls the second with the result of the first as its sample.
64- looks like `[=bowl in=(unit input)]`
65- `bowl` has things like `our`, `now`, `eny` and so forth
66- `bowl` is populated once when the thread is first called and then every time it receives new input
67- `input` contains any incoming pokes, signs and watches.
71- contains `[cards=(list card:agent:gall) <response>]`
72- `cards` are any cards to be sent immediately
73- `<response>` is something like `[%done value]`, `[%fail err]`, etc.
74- `%done` will contain the result
75- responses are only used internally to manage the flow of the thread and are not returned to subscribers.
79- is located in `/lib/strandio/hoon`
80- contains a collection of ready-made functions for use in threads
81- eg. `sleep`, `get-bowl`, `take-watch`, `poke`, `fetch-json`, etc.
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