http://mf34jlghauz5pxjcmdymdqbe5pva4v24logeys446tdrgd5lpsrocmqd.onion/tutorials/down_the_rabbit_hole.html
Stem's Controller does this with its add_event_listener() method,
but with our raw Tor access we can also subscribe with SETEVENTS [event
types] . Events we've received are available in two different ways. First, /events provides a quick dump of the events we've received thus far... You can list events of just a certain type by saying which (for instance /events BW ).