on master help sign in
Merge pull request #1371 from urbit/child-thread-typo

swaps argument order in child thread example

commit2debbe6ec652824f19efd2bf1c794b9123cc8daf authortinnus-napbus <77721746+tinnus-napbus@users.noreply.github.com> dateMon 25 Apr 2022, 04:24 (5 years ago) parentbb0e4797446724
1 file changed+8−5
content/docs/userspace/threads/examples/child-thread.md+8−5
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
5656
5757## Start thread and get its result
5858
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`.
6061
6162#### `parent.hoon`
6263
@@ -74,7 +75,7 @@ If we want to actually get the result of the thread we started, it's slightly mo
7475;< ~ bind:m %- poke-our
7576 :* %spider
7677 %spider-start
77− !>([`tid.bowl `tid byk.bowl %child !>(~)])
78+ !>([`tid.bowl `tid byk.bowl(q da+now.bowl) %child !>(~)])
7879 ==
7980;< =cage bind:m (take-fact /awaiting/[tid])
8081;< ~ bind:m (take-kick /awaiting/[tid])
@@ -130,7 +131,7 @@ We pre-emptively subscribe for the result. Spider sends the result at `/thread-r
130131;< ~ bind:m %- poke-our
131132 :* %spider
132133 %spider-start
133− !>([`tid.bowl byk.bowl `tid %child !>(~)])
134+ !>([`tid.bowl `tid byk.bowl(q da+now.bowl) %child !>(~)])
134135 ==
135136```
136137
@@ -138,7 +139,9 @@ Spider takes a poke with a mark %spider-start and a vase containing `[parent=(un
138139
139140- `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.
140141- `use` is the thread ID for the thread we're creating
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`.
142+- `beak` is a `[p=ship q=desk r=case]` triple which specifies the desk and
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`.
142145- `file` is the filename of the thread we want to start
143146- `vase` is the vase it will be given as an argument when it's started
144147
@@ -181,7 +184,7 @@ Finally we test whether the thread produced a `%thread-done` or a `%thread-fail`
181184;< ~ bind:m %- poke-our
182185 :* %spider
183186 %spider-start
184− !>([`tid.bowl byk.bowl `tid %child !>(~)])
187+ !>([`tid.bowl byk.bowl(q da+now.bowl) `tid %child !>(~)])
185188 ==
186189;< ~ bind:m (sleep ~s5)
187190%- (slog leaf+"Stopping child thread..." ~)