Home
Ratchet Library :: Advanced Timer Example
API  ·  Manual

Advanced Timers

require "ratchet"

function ctx1()
    local tfd = ratchet.timerfd.new()
    tfd:settime(1.0, 1.0)

    while true do
        local fired = tfd:read()
        print("fire!")
    end
end

local kernel = ratchet.new(function ()
    ratchet.thread.attach(ctx1)
end)
kernel:loop()



Last modified:  Sun, 17 Aug 2014 09:32:32 -0400
Author:  icgood