Class: Rufus::Lua::Coroutine
Overview
(coming soon)
Constant Summary
Constants included from StateMixin
StateMixin::LUA_ENVIRONINDEX, StateMixin::LUA_GCCOLLECT, StateMixin::LUA_GCCOUNT, StateMixin::LUA_GCCOUNTB, StateMixin::LUA_GCRESTART, StateMixin::LUA_GCSETPAUSE, StateMixin::LUA_GCSETSTEPMUL, StateMixin::LUA_GCSTEP, StateMixin::LUA_GCSTOP, StateMixin::LUA_GLOBALSINDEX, StateMixin::LUA_MULTRET, StateMixin::LUA_NOREF, StateMixin::LUA_REFNIL, StateMixin::LUA_REGISTRYINDEX, StateMixin::SIMPLE_TYPES, StateMixin::TBOOLEAN, StateMixin::TFUNCTION, StateMixin::TLIGHTUSERDATA, StateMixin::TNIL, StateMixin::TNONE, StateMixin::TNUMBER, StateMixin::TSTRING, StateMixin::TTABLE, StateMixin::TTHREAD, StateMixin::TUSERDATA
Instance Attribute Summary
Attributes inherited from Ref
Instance Method Summary collapse
-
#resume(*args) ⇒ Object
Resumes the coroutine.
-
#status ⇒ Object
Returns the string status of the coroutine : suspended/running/dead/normal.
Methods inherited from Ref
Constructor Details
This class inherits a constructor from Rufus::Lua::Ref
Instance Method Details
#resume(*args) ⇒ Object
Resumes the coroutine
111 112 113 114 115 116 117 118 119 120 121 |
# File 'lib/rufus/lua/objects.rb', line 111 def resume(*args) bottom = stack_top fetch_library_method('coroutine.resume').load_onto_stack load_onto_stack args.each { |arg| stack_push(arg) } pcall(bottom, args.length + 1, nil, nil, nil) end |
#status ⇒ Object
Returns the string status of the coroutine : suspended/running/dead/normal
126 127 128 129 130 131 132 133 134 |
# File 'lib/rufus/lua/objects.rb', line 126 def status bottom = stack_top fetch_library_method('coroutine.status').load_onto_stack load_onto_stack pcall(bottom, 1, nil, nil, nil) end |