saltstack/salt — pull request #19253 by jacksontj (2014-12-24 21:56:05+00:00)
Title: Refactor of evented runners (#17283)

This is a refactor of #17283 to avoid most of the code duplication-- since we now have async client mixins.

I'm still not sure about the __progress__ global, since it is *very* specific, but I'm not sure having someone having to write out something like:
```
__jid_event__.fire_event({'data': 'Runner is {0}% done'.format(i),
'outputter': 'pprint'},
'progress')
```
Is any better, I guess thats still up for debate ;)

So in addition to the __progress__ global I've added __jid__, __user__, __tag__, and __jid_event__.

As part of that the "low" func now creates a JID and events for all calls to it (so we are consistent). All of these are specific to each execution. __jid_event__ is a new class called "NamespacedEvent" which is just a wrapper to allow for people to fire events from a different base tag, in this case within the runner you could fire an event with tag "foo" and it would end up as "salt/run//foo

@cachedout @whiteinge
Pinging the 2 of you about the __progress__ object vs the Namespaced event. I'm thinking we could maybe generalize the outputter class in the runner to work for wheel and runner, and come up with some way of printing out all events within the namespace-- so people don't have to follow the strict event format from RunnerEvent (which I've removed).