Publish events.

def publish(self, events):
        """Publish events."""
        assert len(events) > 0
        with self.create_producer() as producer:
            for event in events:
                producer.publish(event)