mirror of https://github.com/pulumi/pulumi.git
7587bcd7ec
Previously, the engine would write to io.Writer's to display output. When hosted in `pulumi` these writers were tied to os.Stdout and os.Stderr, but other applications hosting the engine could send them other places (e.g. a log to be sent to an another application later). While much better than just using the ambient streams, this was still not the best. It would be ideal if the engine could just emit strongly typed events and whatever is hosting the engine could care about displaying them. As a first step down that road, we move to a model where operations on the engine now take a `chan engine.Event` and during the course of the operation, events are written to this channel. It is the responsibility of the caller of the method to read from the channel until it is closed (singifying that the operation is complete). The events we do emit are still intermingle presentation with data, which is unfortunate, but can be improved over time. Most of the events today are just colorized in the client and printed to stdout or stderr without much thought. |
||
---|---|---|
.. | ||
testdiagsink.go |