Skip to content

DependencyQueueClass

github-actions[bot] edited this page Nov 24, 2024 · 4 revisions

DependencyQueueClass

dependency_queue.new_dependency_queue

Instantiates a new dependency queue for use with DependencyClass. When the queue is executed, it will install all the dependencies in the order they are given.

Parameters

  • packages (table) - A table of dependency objects, each with a name and url property.
  • cb (function) - A callback function that will be called with two arguments: success and error.

Examples

local queue = DependencyQueueClass.new_dependency_queue({
  { name = "package_1", url = "https://example.com/package_1" },
  { name = "package_2", url = "https://example.com/package_2" },
}, function(success, error)
  if success then
    cecho("All dependencies installed successfully.\n")
  else
    cecho(f "Failed to install dependencies: {error}\n")
  end
end)

-- Alternate syntax

local queue = glu.dependency_queue(...)

dependency_queue.start

Starts the dependency queue after it has been created. The callback will be called once all the dependencies have been installed or if there was an error.

Examples

local queue = glu.dependency_queue.new_dependency_queue(...)
queue:start()
Clone this wiki locally