luadocs/content/lua.api.manual/darktable/darktable.control.md

1.4 KiB

title id weight draft author
darktable.control darktable.control 40 false people

This table contain function to manipulate the control flow of lua programs. It provides ways to do background jobs and other related functions

darktable.control.ending

boolean

TRUE when darktable is terminating Use this variable to detect when you should finish long running jobs

darktable.control.dispatch

function(
  function : function,
  ... : anything
)

Runs a function in the background. This function will be run at a later point, after luarc has finished running. If you do a loop in such a function, please check darktable.control.ending in your loop to finish the function when darktable exits

  • function - function - The call to dispatch
  • ... - anything - extra parameters to pass to the function

darktable.control.sleep

function(
  delay : int
)

Suspends execution while not blocking darktable

  • delay - int - The delay in millisecond to sleep

darktable.control.execute

function(
  command : string
) : int

Run a command in a shell while not blocking darktable

  • command - string - The command to run, as in 'sh -c'
  • return - int - The result of the system call

darktable.control.read

function(
  file : file
)

Block until a file is readable while not blocking darktable This function is not available on Windows builds

  • file - file - The file object to wait for