on master help sign in
Merge pull request #1467 from urbit/fix-threads-again
376cefftinnus-napbus
content/docs/userspace/threads/examples/child-thread.md+3−3
@@ -75,7 +75,7 @@ We note that this is mostly the same as `await-thread:strandio`.
75;< ~ bind:m %- poke-our
75;< ~ bind:m %- poke-our
76 :* %spider
76 :* %spider
77 %spider-start
77 %spider-start
78− !>([`tid.bowl `tid byk.bowl(q da+now.bowl) %child !>(~)])
78+ !>([`tid.bowl `tid byk.bowl(r da+now.bowl) %child !>(~)])
79 ==
79 ==
80;< =cage bind:m (take-fact /awaiting/[tid])
80;< =cage bind:m (take-fact /awaiting/[tid])
81;< ~ bind:m (take-kick /awaiting/[tid])
81;< ~ bind:m (take-kick /awaiting/[tid])
@@ -131,7 +131,7 @@ We pre-emptively subscribe for the result. Spider sends the result at `/thread-r
131;< ~ bind:m %- poke-our
131;< ~ bind:m %- poke-our
132 :* %spider
132 :* %spider
133 %spider-start
133 %spider-start
134− !>([`tid.bowl `tid byk.bowl(q da+now.bowl) %child !>(~)])
134+ !>([`tid.bowl `tid byk.bowl(r da+now.bowl) %child !>(~)])
135 ==
135 ==
136```
136```
137
137
@@ -184,7 +184,7 @@ Finally we test whether the thread produced a `%thread-done` or a `%thread-fail`
184;< ~ bind:m %- poke-our
184;< ~ bind:m %- poke-our
185 :* %spider
185 :* %spider
186 %spider-start
186 %spider-start
187− !>([`tid.bowl byk.bowl(q da+now.bowl) `tid %child !>(~)])
187+ !>([`tid.bowl byk.bowl(r da+now.bowl) `tid %child !>(~)])
188 ==
188 ==
189;< ~ bind:m (sleep ~s5)
189;< ~ bind:m (sleep ~s5)
190%- (slog leaf+"Stopping child thread..." ~)
190%- (slog leaf+"Stopping child thread..." ~)
content/docs/userspace/threads/gall/poke-thread.md+1−1
@@ -29,7 +29,7 @@ Here's a modified agent that pokes our thread. I've replaced some off the previo
29 (pair term term)
29 (pair term term)
30 =/ tid `@ta`(cat 3 'thread_' (scot %uv (sham eny.bowl)))
30 =/ tid `@ta`(cat 3 'thread_' (scot %uv (sham eny.bowl)))
31 =/ ta-now `@ta`(scot %da now.bowl)
31 =/ ta-now `@ta`(scot %da now.bowl)
32− =/ start-args [~ `tid byk.bowl(q da+now.bowl) p.q.vase !>(q.q.vase)]
32+ =/ start-args [~ `tid byk.bowl(r da+now.bowl) p.q.vase !>(q.q.vase)]
33 :_ this
33 :_ this
34 :~
34 :~
35 [%pass /thread/[ta-now] %agent [our.bowl %spider] %watch /thread-result/[tid]]
35 [%pass /thread/[ta-now] %agent [our.bowl %spider] %watch /thread-result/[tid]]
content/docs/userspace/threads/gall/start-thread.md+2−2
@@ -29,7 +29,7 @@ Here's an example of a barebones gall agent that just starts a thread:
29 (pair term term)
29 (pair term term)
30 =/ tid `@ta`(cat 3 'thread_' (scot %uv (sham eny.bowl)))
30 =/ tid `@ta`(cat 3 'thread_' (scot %uv (sham eny.bowl)))
31 =/ ta-now `@ta`(scot %da now.bowl)
31 =/ ta-now `@ta`(scot %da now.bowl)
32− =/ start-args [~ `tid byk.bowl(q da+now.bowl) p.q.vase !>(q.q.vase)]
32+ =/ start-args [~ `tid byk.bowl(r da+now.bowl) p.q.vase !>(q.q.vase)]
33 :_ this
33 :_ this
34 :~
34 :~
35 [%pass /thread/[ta-now] %agent [our.bowl %spider] %poke %spider-start !>(start-args)]
35 [%pass /thread/[ta-now] %agent [our.bowl %spider] %poke %spider-start !>(start-args)]
@@ -116,7 +116,7 @@ We can ignore the input logic, here's the important part:
116```hoon
116```hoon
117=/ tid `@ta`(cat 3 'thread_' (scot %uv (sham eny.bowl)))
117=/ tid `@ta`(cat 3 'thread_' (scot %uv (sham eny.bowl)))
118=/ ta-now `@ta`(scot %da now.bowl)
118=/ ta-now `@ta`(scot %da now.bowl)
119−=/ start-args [~ `tid byk.bowl(q da+now.bowl) p.q.vase !>(q.q.vase)]
119+=/ start-args [~ `tid byk.bowl(r da+now.bowl) p.q.vase !>(q.q.vase)]
120:_ this
120:_ this
121:~
121:~
122 [%pass /thread/[ta-now] %agent [our.bowl %spider] %poke %spider-start !>(start-args)]
122 [%pass /thread/[ta-now] %agent [our.bowl %spider] %poke %spider-start !>(start-args)]
content/docs/userspace/threads/gall/stop-thread.md+1−1
@@ -29,7 +29,7 @@ Here we've added one last card to `on-poke` to stop the thread and a little extr
29 (pair term term)
29 (pair term term)
30 =/ tid `@ta`(cat 3 'thread_' (scot %uv (sham eny.bowl)))
30 =/ tid `@ta`(cat 3 'thread_' (scot %uv (sham eny.bowl)))
31 =/ ta-now `@ta`(scot %da now.bowl)
31 =/ ta-now `@ta`(scot %da now.bowl)
32− =/ start-args [~ `tid byk.bowl(q da+now.bowl) p.q.vase !>(q.q.vase)]
32+ =/ start-args [~ `tid byk.bowl(r da+now.bowl) p.q.vase !>(q.q.vase)]
33 :_ this
33 :_ this
34 :~
34 :~
35 [%pass /thread/[ta-now] %agent [our.bowl %spider] %watch /thread-result/[tid]]
35 [%pass /thread/[ta-now] %agent [our.bowl %spider] %watch /thread-result/[tid]]
content/docs/userspace/threads/gall/take-facts.md+1−1
@@ -31,7 +31,7 @@ Here we've added another card to subscribe for any facts sent by the thread and
31 (pair term term)
31 (pair term term)
32 =/ tid `@ta`(cat 3 'thread_' (scot %uv (sham eny.bowl)))
32 =/ tid `@ta`(cat 3 'thread_' (scot %uv (sham eny.bowl)))
33 =/ ta-now `@ta`(scot %da now.bowl)
33 =/ ta-now `@ta`(scot %da now.bowl)
34− =/ start-args [~ `tid byk.bowl(q da+now.bowl) p.q.vase !>(q.q.vase)]
34+ =/ start-args [~ `tid byk.bowl(r da+now.bowl) p.q.vase !>(q.q.vase)]
35 :_ this
35 :_ this
36 :~
36 :~
37 [%pass /thread/[ta-now] %agent [our.bowl %spider] %watch /thread-result/[tid]]
37 [%pass /thread/[ta-now] %agent [our.bowl %spider] %watch /thread-result/[tid]]
content/docs/userspace/threads/gall/take-result.md+1−1
@@ -29,7 +29,7 @@ Here we've added an extra card to subscribe for the result and a couple of lines
29 (pair term term)
29 (pair term term)
30 =/ tid `@ta`(cat 3 'thread_' (scot %uv (sham eny.bowl)))
30 =/ tid `@ta`(cat 3 'thread_' (scot %uv (sham eny.bowl)))
31 =/ ta-now `@ta`(scot %da now.bowl)
31 =/ ta-now `@ta`(scot %da now.bowl)
32− =/ start-args [~ `tid byk.bowl(q da+now.bowl) p.q.vase !>(q.q.vase)]
32+ =/ start-args [~ `tid byk.bowl(r da+now.bowl) p.q.vase !>(q.q.vase)]
33 :_ this
33 :_ this
34 :~
34 :~
35 [%pass /thread/[ta-now] %agent [our.bowl %spider] %watch /thread-result/[tid]]
35 [%pass /thread/[ta-now] %agent [our.bowl %spider] %watch /thread-result/[tid]]
content/docs/userspace/threads/reference.md+1−1
@@ -25,7 +25,7 @@ Where:
25 [%ud p=@ud] :: number
25 [%ud p=@ud] :: number
26 ==
26 ==
27 ```
27 ```
28− You'll almost always just want the current revision, so you can specify the `case` as `da+now.bowl`. If the thread is on the same desk as the agent, you can also just use `byk.bowl` for the `beak`.
28+ You'll almost always just want the current revision, so you can specify the `case` as `da+now.bowl`. If the thread is on the same desk as the agent you can also just use `byk.bowl(r da+now)` for the `beak`.
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`.
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`.
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.
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.
31
31