Skip to content

process

Define a process. The returned constructor starts a new process each time you call it.

Parameters

  • fn — The process body. It receives the process fields as self.
  • options? — A table with defaults and children_attached.
local Walk = process(function(self)
self.x = self.x + 1
frame()
end)
Walk({x = 10})

Related: mv.process.define, spawn, frame, start.

See the lua processes guide for more examples and limits.