on master help sign in
update threads ref wrt dist
2d43218tinnus-napbus
content/docs/userspace/threads/reference.md+11−2
@@ -10,20 +10,29 @@ Poke `spider` with mark `%spider-start` and a vase containing `start-args`:
10
10
11```hoon
11```hoon
12+$ start-args
12+$ start-args
13− [parent=(unit tid) use=(unit tid) file=term =vase]
13+ [parent=(unit tid) use=(unit tid) =beak file=term =vase]
14```
14```
15
15
16Where:
16Where:
17
17
18- `parent` - optional `tid` of parent thread if the thread is a child. If specified, the child thread will be killed with the parent thread ends.
18- `parent` - optional `tid` of parent thread if the thread is a child. If specified, the child thread will be killed with the parent thread ends.
19- `use` - `tid` (thread ID) to give the new thread. Can be generated with something like `(scot %ta (cat 3 'my-agent_' (scot %uv (sham eny))))`. However you do it, make sure it's unique.
19- `use` - `tid` (thread ID) to give the new thread. Can be generated with something like `(scot %ta (cat 3 'my-agent_' (scot %uv (sham eny))))`. However you do it, make sure it's unique.
20+- `beak` - A `$beak` is a triple of `[p=ship q=desk r=case]`. `p` is always our ship, `q` is the desk which contains the thread we want to run. `r` is a `case`, which specifies a desk revision and is a tagged union of:
21+ ```hoon
22+ +$ case
23+ $% [%da p=@da] :: date
24+ [%tas p=@tas] :: label
25+ [%ud p=@ud] :: number
26+ ==
27+ ```
28+ You'll almost always just want the current revision, so you can specify the `case` as `da+now.bowl`.
20- `file` - name of the thread file in `/ted`. For example, if the thread you want to start is `/ted/foo/hoon` you'd specify `%foo`.
29- `file` - name of the thread file in `/ted`. For example, if the thread you want to start is `/ted/foo/hoon` you'd specify `%foo`.
21- `vase` - `vase` to be given to the thread when it's started. Can be whatever or just `!>(~)` if it doesn't need any args.
30- `vase` - `vase` to be given to the thread when it's started. Can be whatever or just `!>(~)` if it doesn't need any args.
22
31
23#### Example
32#### Example
24
33
25```hoon
34```hoon
26−[%pass /some-path %agent [our.bowl %spider] %poke %spider-start !>([~ `tid %foo !>(~)])]
35+[%pass /some-path %agent [our.bowl %spider] %poke %spider-start !>([~ `tid [our.bowl %base da+now.bowl] %foo !>(~)])]
27```
36```
28
37
29## Stop thread
38## Stop thread