def METHOD_NAME(self, timeout, callback, context=None):
    if context is None:
        context = GLib.MainContext.get_thread_default()
    self.cancel()
    def handler(*_):
        self.source = None
        callback()
        return GLib.SOURCE_REMOVE
    self.source = GLib.timeout_source_new(max(0, timeout))
    self.source.set_callback(handler)
    self.source.attach(context)