code: def register_callback(self, callback):
          
          if not callable(callback):
              raise ValueError('callback is not a callable')
  
          self.callbacks.append(callback)
docs: Register a new callback.
  
          Note:
              The callback will be executed in the AlarmTask context and for
              this reason it should not block, otherwise we can miss block
              changes.