public interface ILuaContext
Modifier and Type | Method and Description |
---|---|
java.lang.Object[] |
executeMainThreadTask(ILuaTask task)
TODO: Document me
|
long |
issueMainThreadTask(ILuaTask task)
TODO: Document me
|
java.lang.Object[] |
pullEvent(java.lang.String filter)
Wait for an event to occur on the computercraft, suspending the thread until it arises.
|
java.lang.Object[] |
pullEventRaw(java.lang.String filter)
The same as pullEvent(), except "terminated" events are ignored.
|
java.lang.Object[] |
yield(java.lang.Object[] arguments)
Yield the current coroutine with some arguments until it is resumed.
|
java.lang.Object[] pullEvent(java.lang.String filter) throws LuaException, java.lang.InterruptedException
filter
- A specific event to wait for, or null to wait for any eventjava.lang.Exception
- If the user presses CTRL+T to terminate the current program while pullEvent() is waiting for an event, a "Terminated" exception will be thrown here.
Do not attempt to common this exception, unless you wish to prevent termination, which is not recommended.java.lang.InterruptedException
- If the user shuts down or reboots the computercraft while pullEvent() is waiting for an event, InterruptedException will be thrown. This exception must not be caught or intercepted, or the computercraft will leak memory and end up in a broken state.LuaException
java.lang.Object[] pullEventRaw(java.lang.String filter) throws java.lang.InterruptedException
filter
- A specific event to wait for, or null to wait for any eventjava.lang.InterruptedException
- If the user shuts down or reboots the computercraft while pullEventRaw() is waiting for an event, InterruptedException will be thrown. This exception must not be caught or intercepted, or the computercraft will leak memory and end up in a broken state.pullEvent(String)
java.lang.Object[] yield(java.lang.Object[] arguments) throws java.lang.InterruptedException
arguments
- An object array containing the arguments to pass to coroutine.yield()java.lang.InterruptedException
- If the user shuts down or reboots the computercraft the coroutine is suspended, InterruptedException will be thrown. This exception must not be caught or intercepted, or the computercraft will leak memory and end up in a broken state.pullEvent(String)
java.lang.Object[] executeMainThreadTask(ILuaTask task) throws LuaException, java.lang.InterruptedException
task
- LuaException
java.lang.InterruptedException
long issueMainThreadTask(ILuaTask task) throws LuaException
task
- LuaException