Software /
code /
prosody
Comparison
util/async.lua @ 7725:f928695a2af1
util.async: Add annotation to ignore warning [luacheck]
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 19 Nov 2016 01:11:28 +0100 |
parent | 7724:20a69ef5570c |
child | 8237:f81cd9aaf994 |
comparison
equal
deleted
inserted
replaced
7724:20a69ef5570c | 7725:f928695a2af1 |
---|---|
83 | 83 |
84 local runner_mt = {}; | 84 local runner_mt = {}; |
85 runner_mt.__index = runner_mt; | 85 runner_mt.__index = runner_mt; |
86 | 86 |
87 local function runner_create_thread(func, self) | 87 local function runner_create_thread(func, self) |
88 local thread = coroutine.create(function (self) | 88 local thread = coroutine.create(function (self) -- luacheck: ignore 432/self |
89 while true do | 89 while true do |
90 func(coroutine.yield("ready", self)); | 90 func(coroutine.yield("ready", self)); |
91 end | 91 end |
92 end); | 92 end); |
93 assert(coroutine.resume(thread, self)); -- Start it up, it will return instantly to wait for the first input | 93 assert(coroutine.resume(thread, self)); -- Start it up, it will return instantly to wait for the first input |