## utils.task module

Threading simulation module Task.sleep()

github: https://github.com/Refactorio/RedMew ======================================================= --

- Author: Valansch and Grilledham

### Dependencies

utils.queue
utils.priority_queue
utils.event
utils.token

### Functions

Task.set_timeout_in_ticks(ticks, func_token, params) | Allows you to set a timer (in ticks) after which the tokened function will be run with params given as an argument Cannot be called before init
Task.set_timeout(sec, func_token, params) | Allows you to set a timer (in seconds) after which the tokened function will be run with params given as an argument Cannot be called before init
Task.queue_task(func_token, params, weight) | Queueing allows you to split up heavy tasks which don't need to be completed in the same tick.

### Dependencies

# utils.queue
# utils.priority_queue
# utils.event
# utils.token

### Functions

# Task.set_timeout_in_ticks(ticks, func_token, params)

  Allows you to set a timer (in ticks) after which the tokened function will be run with params given as an argument Cannot be called before init

  Parameters:
  - ticks : <number>
  - func_token : <number> a token for a function store via the token system
  - params : <any> the argument to send to the tokened function
# Task.set_timeout(sec, func_token, params)

  Allows you to set a timer (in seconds) after which the tokened function will be run with params given as an argument Cannot be called before init

  Parameters:
  - sec : <number>
  - func_token : <number> a token for a function store via the token system
  - params : <any> the argument to send to the tokened function
# Task.queue_task(func_token, params, weight)

  Queueing allows you to split up heavy tasks which don't need to be completed in the same tick.

  Queued tasks are generally run 1 per tick. If the queue backs up, more tasks will be processed per tick. Ex. if the task is expected to repeat multiple times (ie. the function returns true and loops several ticks)

  Parameters:
  - func_token : <number> a token for a function stored via the token system If this function returns `true` it will run again the next tick, delaying other queued tasks (see weight)
  - params : <any> the argument to send to the tokened function
  - weight : <number> (defaults to 1) weight is the number of ticks a task is expected to take.