So Summer 17 brings the new Apex Metadata API. What I am trying to do is start a deployment from a Visualforce page, and then display the results on the page once the deployment has completed.
Since there is not yet a deploy status API (as noted in the above post), I can't poll the status using Javascript Remoting. My only option seems to be to use Metadata.DeployCallback.
One thought I had was to create a platform event, have the Visualforce page subscribe to it, and then publish it from the callback. There would be no need to do any polling. Except it seems that when the callback publishes an event, nothing happens. The callback is being called, the platform event works outside of the callback, DML works inside of the callback, but platform events do not seem to work inside of the callback. There are no errors in the debug log.
Which seems to leave me with creating a custom object, storing the results in it from the callback, and then polling for those results with Javascript Remoting. At that point it just seems easier to use the FF wrapper.
Any ideas?