2title = "Iris Public API"
9In this document we describe the public interface for Iris. Namely, we describe
10each `task` that Iris can be `%pass`ed, and which `gift`(s) Iris can `%give` in
15Much of what Iris does is translating `task`s from other vanes into `card`s
16meant for Unix via the `%request` and `%cancel-request` `task`s. What this means in practice is that Iris may be `%pass`ed a
17`task` via some `duct`, which in response Iris then `%give`s a `gift` to Unix
18via another `duct`. This `gift` will actually be a response to the `%born`
19`task` that Iris was `%pass`ed when the Urbit was resumed, which came along the
27Each time you start your Urbit the Arvo kernel calls the `%born` `task` for
28Iris. This causes Iris to cancel any outstanding http requests and resets all
39In response to a `%born` `task` Iris `give`s a `%http-response %cancel` `gift`
40to each outstanding connection.
45This `task` cancels a previous fetch. Iris knows which request is meant based on the
46`duct` that the `task` comes on.
48 We note that `%cancel-request` is also a `gift` that Iris can `%give`.
59[%cancel-request id=@ud]
61Receiving this `task` causes Iris to `%give`s a `%cancel-request` `gift` to Unix,
62which then cancels the request in the runtime. See [Returns to Unix](#returns-to-unix).
64`id` is obtained via a `(map duct @ud)`, with the `duct` corresponding to one along
65which the `%cancel-request` `task` came with.
70`%crud` is called whenever an error involving Iris occurs. It produces a crash
79`p` is the type of error, `q` is the error message.
83Iris does not `%give` a `gift` in response to a `%crud` `task`, but it does
84`%slip` Dill a `%flog` `task` instructing it to print the error.
89The `%receive` `task` is used to receive a response from Unix to an `http-request` that
95[id=@ud =http-event:http]
98`id` is the identification number assigned by Iris to the http connection under
99consideration. `http-event` is a packet that contains a header and data.
103The response depends on what kind of packet `http-event` is: `%start`,
104`%continue`, or `%cancel` and whether the `complete` flag is `%.y` or `%.n`.
106If the packet says to `%start` or `%continue` and `complete=%.n`, Iris will `%give` a
107`%http-response %progress` `gift`.
109If the packet says to `%start` or `%continue` and `complete=%.y`, Iris will
110`%give` a `%http-response %finished` `gift`.
112If the packet says to `%cancel`, Iris will `%give` a `%http-response %cancel`
113`gift` in return. The `complete` flag is unused here.
118`%request` is used to fetch a remote resource. `%request` is also a `gift` Iris
124[=request:http =outbound-config]
127A `$request` consists of the following:
128 - `=method`, the http method, which is one of `CONNECT`, `DELETE`, `GET`,
129 `HEAD`, `OPTIONS`, `POST`, `PUT`, and `TRACE`.
130 - `url=@t`, the URL being requested
131 - `=header-list`, a list of headers to pass with the request,
132 - `body=(unit octs)`, optional data to include in the request.
134 A `$outbound-config` contains the number of redirects and retries that Iris
135 will attempt. By default this is 5 redirects (the recommended limit for the
136 http standard) and 3 retries.
141[id=@ud request=request:http]
143Iris will `%give` a `%request` `gift` to Unix in response to a `%request`
144`task`. See [Returns to Unix](#returns-to-unix). This `gift`
145contains the `request` in the original `task` as well as the ID number assigned
146by Iris for that particular http connection, which is extracted from the input `task`.
151This `task` is sent by the interpreter to free up memory. It has no effect on Iris.
161This `task` returns no `gift`s.
166This `task` informs the vane that the kernel has been upgraded. Iris does not do
167anything in response to this.
177This `task` returns no `gift`s.
182This `task` asks Iris to product a memory usage report.
186This `task` has no arguments.
190When Iris is `%pass`ed this `task`, it will `%give` a `%mass` `gift` in response
191containing Iris' current memory usage.
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list