Connect
Connect sets a callback for a given message when it is sent. A message can only have one connection, but you can always
connect your messages into a choice signal implementation. Callbacks can be removed with
light.disconnect()
. Message callbacks will be spawned asynchronously with thread reuse. To
create a non-yielding callback you can use light.connect_sync()
This function can error if there is already a callback connected.
Consider calling light.disconnect()
first if this is an issue.
function light.connect
function light.connect
Some example code using light.connect()
: