@@ -13,58 +13,167 @@ each `task` that Iris can be `%pass`ed, and which `gift`(s) Ames can `%give` in
14### `%born`
14### `%born`
16+Each time you start your Urbit the Arvo kernel calls the `%born` `task` for
17+Iris. This causes Iris to cancel any outstanding http requests and resets all
16#### Accepts
20#### Accepts
18#### Returns
26#### Returns
28+In response to a `%born` `task` Iris `give`s a `%http-response %cancel` `gift`
29+to each outstanding connection.
21### `%cancel-request`
32### `%cancel-request`
34+This `task` cancels a previous fetch. Iris knows which request is meant based on the
35+`duct` that the `task` comes on.
37+ We note that `%cancel-request` is also a `gift` that Iris can `%give`.
23#### Accepts
39#### Accepts
25#### Returns
45#### Returns
48+[%cancel-request id=@ud]
50+Iris `%give`s a `%cancel-request` `gift` in response to this `task`. `id` is
51+obtained via a `(map duct @ud)`, with the `duct` corresponding to one along
52+which the `%cancel-request` `task` came with.
29### `%crud`
55### `%crud`
57+`%crud` is called whenever an error involving Iris occurs. It produces a crash
32#### Accepts
60#### Accepts
63+[p=@tas q=(list tank)]
66+`p` is the type of error, `q` is the error message.
34#### Returns
68#### Returns
70+Iris does not `%give` a `gift` in response to a `%crud` `task`, but it does
71+`%slip` Dill a `%flog` `task` instructing it to print the error.
37### `%receive`
74### `%receive`
76+The `%receive` `task` is used to receive a response to an `http-request` that
39#### Accepts
79#### Accepts
82+[id=@ud =http-event:http]
85+`id` is the identification number assigned by Iris to the http connection under
86+consideration. `http-event` is a packet that contains a header and data.
41#### Returns
88#### Returns
90+The response depends on what kind of packet `http-event` is: `%start`,
91+`%continue`, or `%cancel` and whether the `complete` flag is `%.y` or `%.n`.
93+If the packet says to `%start` or `%continue` and `complete=%.n`, Iris will `%give` a
94+`%http-response %progress` `gift`.
96+If the packet says to `%start` or `%continue` and `complete=%.y`, Iris will
97+`%give` a `%http-response %finished` `gift`.
99+If the packet says to `%cancel`, Iris will `%give` a `%http-response %cancel`
100+`gift` in return. The `complete` flag is unused here.
44### `%request`
103### `%request`
105+`%request` is used to fetch a remote resource. `%request` is also a `gift` Iris
46#### Accepts
108#### Accepts
111+[=request:http =outbound-config]
114+A `$request` consists of the following:
115+ - `=method`, the http method, which is one of `CONNECT`, `DELETE`, `GET`,
116+ `HEAD`, `OPTIONS`, `POST`, `PUT`, and `TRACE`.
117+ - `url=@t`, the URL being requested
118+ - `=header-list`, a list of headers to pass with the request,
119+ - `body=(unit octs)`, optional data to include in the request.
121+ A `$outbound-config` contains the number of redirects and retries that Iris
122+ will attempt. By default this is 5 redirects (the recommended limit for the
123+ http standard) and 3 retries.
48#### Returns
125#### Returns
128+[id=@ud request=request:http]
130+Iris will `%give` a `%request` `gift` in response to a `%request` `task`. This
131+contains the `request` in the original `task` as well as the ID number assigned
132+by Iris for that particular http connection, which is extracted from the input `task`.
51### `%trim`
135### `%trim`
137+This `task` is sent by the interpreter to free up memory. It has no effect on Iris.
53#### Accepts
139#### Accepts
55#### Returns
145#### Returns
147+This `task` returns no `gift`s.
58### `%vega`
150### `%vega`
152+This `task` informs the vane that the kernel has been upgraded. Iris does not do
153+anything in response to this.
60#### Accepts
155#### Accepts
62#### Returns
161#### Returns
163+This `task` returns no `gift`s.
65### `%wegh`
166### `%wegh`
168+This `task` asks Iris to product a memory usage report.
67#### Accepts
170#### Accepts
172+This `task` has no arguments.
69#### Returns
174#### Returns
176+When Iris is `%pass`ed this `task`, it will `%give` a `%mass` `gift` in response
177+containing Iris' current memory usage.