Vat

From Erights

(Difference between revisions)
Jump to: navigation, search
m (Example: How to create a new Vat)
m (Example: How to create a new Vat)
Line 7: Line 7:
# value: ["3DES_SDH_M2", "3DES_SDH_M"]
# value: ["3DES_SDH_M2", "3DES_SDH_M"]
-
? def  seedVatAuthor := <elang:interp.seedVatAuthor>(<unsafe>).virtualize((introducer))
+
? def  seedVatAuthor := <elang:interp.seedVatAuthor>(<unsafe>).virtualize(introducer)
# value: <virtualSeedVat>
# value: <virtualSeedVat>

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>

Personal tools
more tools