gre.receive_event

gre.receive_event(
    channel
)
            

Receive an event from a Storyboard IO channel.  This is a blocking call and works best when used on a separate Lua thread.


Parameters:
        channel    A Storyboard IO channel to receive the event on.

Returns:
        event       A table containing the name, target, format and a data table from a received event.

Example:
            

-- Receive a Storyboard IO event with data payload x, y, z:
ev = gre.receive_event("my_channel")

if ev ~= nil then
    print(ev.name)

    for k,v in pairs(ev.data) do
        print(tostring(k).." "..tostring(v))
    end
end

--To disconnect from my_channel:
gre.greio_disconnect("my_channel", true)