code: def task_add(self, t, periodic=None):
          
          name = t.get_name()
          if name in self._tasknames:
              raise TaskError(name, 'Task already exists with %d daemon%s active' %
                              (len(self._tasknames), ses(len(self._tasknames))))
          self._tasknames[name] = (t, periodic)
          self._tasks.add(t)
docs: Register a task in this legion.  "periodic" should be None, or
          a callback function which will be called periodically when the
          legion is otherwise idle.