monte-language / typhon

A virtual machine for Monte.
Other
67 stars 10 forks source link

Event-logged vats #158

Closed MostAwesomeDude closed 6 years ago

MostAwesomeDude commented 7 years ago

Vats should compute I/O effects by stashing the effect in an "event log", a simple FIFO queue which can be run in-between turns to perform I/O.

This is necessary as part of the leadup to Typhon running vats in parallel with a threadpool.

MostAwesomeDude commented 7 years ago

We should ensure that this design:

I'm imagining a class for events:

class Event(object):
    pass

To create a new kind of event, just subclass. Sending an event to a vat should be easy:

event = MyCoolEvent(my, cool, params)
p = currentVat.get().queueEvent(event)

Returning a promise which can be wielded normally.