code: def destroy(self):
          
  
          if getattr(self, 'publisher', None):
              self.log.debug("closing fedmsg publisher")
              self.log.debug("sent %i messages" % self._i)
              self.publisher.close()
              self.publisher = None
  
          if getattr(self, 'context', None):
              self.context.term()
              self.context = None
docs: Destroy a fedmsg context