Vat
From Erights
(Difference between revisions)
(Created seedVatAuthor example) |
m (→Example: How to create a new Vat) |
||
Line 20: | Line 20: | ||
? Thing: Hello Vat | ? Thing: Hello Vat | ||
+ | |||
+ | #shutting down the vat | ||
+ | ? def ack := vat <- orderlyShutdown("because I said so") | ||
+ | # value: <Promise> | ||
+ | |||
</pre> | </pre> |
Revision as of 11:36, 21 April 2007
See [1].
Example: How to create a new Vat
introducer.onTheAir() # value: ["3DES_SDH_M2", "3DES_SDH_M"] ? def seedVatAuthor := <elang:interp.seedVatAuthor>(<unsafe>).virtualize((introducer)) # value: <virtualSeedVat> ? def scriptSource:="def run(thing) {println(`Thing: $thing`)}" # value: "def run(thing) {println(`Thing: $thing`)}" ? def [scriptObj, vat] := seedVatAuthor(scriptSource) # value: [<Promise>, <Vat newVirtualSeedVat in <runs in newVirtualSeedVat>>] ? scriptObj<-run("Hello Vat") # value: <Remote Promise> ? Thing: Hello Vat #shutting down the vat ? def ack := vat <- orderlyShutdown("because I said so") # value: <Promise>