on master help sign in
Merge pull request #1371 from urbit/child-thread-typo
2debbe6tinnus-napbus
content/docs/userspace/threads/examples/child-thread.md+8−5
@@ -56,7 +56,8 @@ Note that threads we start this way will be a child of the thread that started t
56
56
57## Start thread and get its result
57## Start thread and get its result
58
58
59−If we want to actually get the result of the thread we started, it's slightly more complicated:
59+If we want to actually get the result of the thread we started, it's slightly more complicated.
60+We note that this is mostly the same as `await-thread:strandio`.
60
61
61#### `parent.hoon`
62#### `parent.hoon`
62
63
@@ -74,7 +75,7 @@ If we want to actually get the result of the thread we started, it's slightly mo
74;< ~ bind:m %- poke-our
75;< ~ bind:m %- poke-our
75 :* %spider
76 :* %spider
76 %spider-start
77 %spider-start
77− !>([`tid.bowl `tid byk.bowl %child !>(~)])
78+ !>([`tid.bowl `tid byk.bowl(q da+now.bowl) %child !>(~)])
78 ==
79 ==
79;< =cage bind:m (take-fact /awaiting/[tid])
80;< =cage bind:m (take-fact /awaiting/[tid])
80;< ~ bind:m (take-kick /awaiting/[tid])
81;< ~ bind:m (take-kick /awaiting/[tid])
@@ -130,7 +131,7 @@ We pre-emptively subscribe for the result. Spider sends the result at `/thread-r
130;< ~ bind:m %- poke-our
131;< ~ bind:m %- poke-our
131 :* %spider
132 :* %spider
132 %spider-start
133 %spider-start
133− !>([`tid.bowl byk.bowl `tid %child !>(~)])
134+ !>([`tid.bowl `tid byk.bowl(q da+now.bowl) %child !>(~)])
134 ==
135 ==
135```
136```
136
137
@@ -138,7 +139,9 @@ Spider takes a poke with a mark %spider-start and a vase containing `[parent=(un
138
139
139- `parent` is an optional parent thread. In this case we say the parent is our tid. Specifying a parent means the child will be killed if the parent ends.
140- `parent` is an optional parent thread. In this case we say the parent is our tid. Specifying a parent means the child will be killed if the parent ends.
140- `use` is the thread ID for the thread we're creating
141- `use` is the thread ID for the thread we're creating
142+- `beak` is a `[p=ship q=desk r=case]` triple which specifies the desk and
141−- `beak` is a `[p=ship q=desk r=case]` triple which specifies the desk and revision containing the thread we want to run. In this case we just use `byk.bowl`.
143+ revision containing the thread we want to run. In this case we just use
144+ `byk.bowl`, but with the date of revision `q` changed to `now.bowl`.
142- `file` is the filename of the thread we want to start
145- `file` is the filename of the thread we want to start
143- `vase` is the vase it will be given as an argument when it's started
146- `vase` is the vase it will be given as an argument when it's started
144
147
@@ -181,7 +184,7 @@ Finally we test whether the thread produced a `%thread-done` or a `%thread-fail`
181;< ~ bind:m %- poke-our
184;< ~ bind:m %- poke-our
182 :* %spider
185 :* %spider
183 %spider-start
186 %spider-start
184− !>([`tid.bowl byk.bowl `tid %child !>(~)])
187+ !>([`tid.bowl byk.bowl(q da+now.bowl) `tid %child !>(~)])
185 ==
188 ==
186;< ~ bind:m (sleep ~s5)
189;< ~ bind:m (sleep ~s5)
187%- (slog leaf+"Stopping child thread..." ~)
190%- (slog leaf+"Stopping child thread..." ~)