Type deai.plugin.lua:Proxy

Lua proxy of a deai object

When you create a deai object, a proxy object is created in lua. Some extra methods are available from these proxies.

Methods

on(signal, callback)

Listen for signals

once(signal, callback)

Listen for signals only once

on(signal, callback) ListenHandle
Return type:

ListenHandle

Parameters:

signal (string)

Listen for signals

Returns a handle. The handle can be used to stop the signal listener, by calling the “stop” method.

If the handle is garbage collected, the listener will be left running forever.

once(signal, callback) ListenHandle
Return type:

ListenHandle

Parameters:

signal (string)

Listen for signals only once

Same as on(), except the callback will only be called for the first time the signal is received.