on 6d45ede help sign in
133 lines 4.2 kB history raw
1---
2navhome: /docs
3sort: 7
4---
7`%gall`
8=======
10Our application server manager.
12It allows applications and vanes to send messages to applications and
13subscribe to data streams. This requires `%gall` to be a sort of a
14hypervisor. Messages coming into `%gall` are routed to the intended
15application, and the response comes back along the same route. If the
16intended target is on another ship, `%gall` will behind-the-scenes route
17it through ames to the other ship to run. This provides an abstraction
18where all apps on all ships are communicated with over the same
19interface.
21`%gall` neither accepts events from unix nor produces effects. It exists
22entirely for the benefit of other vanes and, in particular,
23applications. Eyre exposes `%gall`'s interface over http, and ames does
24the same over the ames network. `%gall` uses ford to compile and run the
25applications.
27Cards
28-----
30`%gall` accepts the following cards. The first three are the most
31commonly used, while the others are primarily used internally.
33### `%mess`
35Sends a message to an app. This will result in a call to the app's
36`++poke` arm. The response is exactly one of a `%nice` if the action
37succeeded or a `%mean` if not.
39### `%show`
41Subscribes to a stream from an app. This will result in a call to the
42app's either `++peek` or `++peer` arm. The first response will always be
43either a `%nice` or a `%mean`, indicating whether or not the
44subscription was successful. After the first response, there will be
45zero or more responses of either `%rush` or `%rust`, which communicate
46either a differntial or full update to the data stream. There may be a
47`%mean`, which indicates that the subscription has been canceled and no
48more responses will be received along this stream.
51### `%nuke`
53Unsubscribes the current duct from its stream. This receives a response
54of either a `%nice` or a `%mean`. Note that a response of `%nice` does
55not imply that the current duct was in fact subscribed to any stream.
57### `%init`
59Initializes a ship's apps. This should be called exactly once for each
60ship on the pier. This produces no moves in response.
62### `%sire`
64Instantiates a child app. The app will be at path `[p parent-path]`, and
65it will be an instance of the `q` app. The only response will be `%gone`
66when the child dies.
69### `%rote`
71Signifies a remote request from ames. `r` should be of type `rook`. This
72how an app on a foreign ship may send a `%mess`, `%show`, or `%nuke`
73card. Note that `%gall` automatically converts `%mess`, `%show`, and
74`%nuke` into ames messages behind the scenes, so the only entity that
75should use `%rote` and `%roth` is ames. Formally, the response is either
76a `%nice` or a `%mean`, which ames uses to give a positive or negative
77ack. A logical response comes by passing a `%roth` card.
80### `%roth`
82Gives the response received from a remote request. `r` should be of type
83`roon`. This is how an app responds to a foreign request with a `%rush`,
84`%rust`, `%nice`, or `%mean`. The response is either a `%nice` or a
85`%mean`. Even though we, as the proverb goes, "never ack an ack", we do
86need to acknowledge these responses since they're really independent
87one-way messages.
90### `%wipe`
92Wipes the given app from memory. This is generally considered a hack,
93but it is sometimes useful during development to wipe the state of an
94app. We don't guarantee that this actually completely wipes the app.
95Generally, you want to use a `%cide` card if you actually want to kill
96an app. This gives no response.
99### `%cide`
101Kills an app and all its children. Even though it's not technically a
102part of `%gall`'s interface since it's not in `++kiss` and can't be
103called from the outside, it's worth mentioning `%cide`, which may be
104called from within `%gall` apps. It should call `++part` to allow the
105app any last words. This gives no response.
107Service Gates
108-------------
110### `++poke`
112Handles incoming messages. Most commonly with an associated `%logo`. For
113example `++poke-json` handles an incoming JSON request from `%eyre`.
115### `++peer`
117Handles incoming subscriptions.
119### `++pull`
121Handles dropping subscribers.
123### `++pour`
125Handles responses to `%pass` moves.
127### `++park`
129Save state on update.
131### `++prep`
133Load state on update.