on master help sign in
gall-guide: arvo - remove comparison of threads to agents
c44368cTinnus Napbus
content/docs/userspace/gall-guide/1-arvo.md+13−11
@@ -96,17 +96,19 @@ there's also:
96 When you do something like `:dojo|wipe` in the dojo, you're actually running
96 When you do something like `:dojo|wipe` in the dojo, you're actually running
97 the `/gen/dojo/wipe.hoon` generator and poking the `%dojo` agent with its
97 the `/gen/dojo/wipe.hoon` generator and poking the `%dojo` agent with its
98 output.
98 output.
99−- **Threads**: These are kind of like mini transient Gall agents, and are managed by
99+- **Threads**: While generators are for strictly synchronous operations, threads
100+ make it easy to implement sequences of asynchronous operations. Threads are
100− the `%spider` agent. They can be used as mere scripts like generators, but
101+ managed by the `%spider` agent. They can be used as mere scripts like
101− their main purpose is for performing complex IO. For example, suppose you need
102+ generators, but their main purpose is for performing complex IO. For example,
102− to query some external web API, then with the data in its response you make
103+ suppose you need to query some external web API, then with the data in its
103− another API call, and then another, before finally having the data you need.
104+ response you make another API call, and then another, before finally having
104− If one of the API calls fails, your Gall agent is potentially left in a
105+ the data you need. If one of the API calls fails, your Gall agent is
105− strange intermediary state. Instead, you can put all the IO logic in a
106+ potentially left in a strange intermediary state. Instead, you can put all the
106− separate thread which is completely atomic. That way the Gall agent only has
107+ IO logic in a separate thread which is completely atomic. That way the Gall
107− to deal with the two conditions of success or failure. Writing threads is
108+ agent only has to deal with the two conditions of success or failure. Writing
109+ threads is covered in a [separate
108− covered in a [separate guide](/docs/userspace/threads/basics/fundamentals),
110+ guide](/docs/userspace/threads/basics/fundamentals), which you might like to
109− which you might like to work through after completing the Gall Guide.
111+ work through after completing the Gall Guide.
110
112
111- **Front-end**: Web UIs. It's possible for Gall agents to handle HTTP requests
113- **Front-end**: Web UIs. It's possible for Gall agents to handle HTTP requests
112 directly and dynamically produce responses, but it's also possible to have a
114 directly and dynamically produce responses, but it's also possible to have a