Motor Kütüphanesi
coroutine
*Bu içerik, yapay zekâ (beta) kullanılarak çevrildi ve hatalar içerebilir. Sayfayı İngilizce görüntülemek için buraya tıkla.
Özet
İşlevler
API Referansı
İşlevler
close
create
finally
coroutine.finally(
Parametreler
callback:Variant |
Kod Örnekleri
Koroitinin Sonu
local function observe(co, label)
coroutine.finally(co, function(status, ...)
print(label, status, ...)
end)
end
local finishing = coroutine.create(function()
return "sonuç"
end)
observe(finishing, "bitiriliyor") --> bitiriliyor bitmiş sonuç
coroutine.resume(finishing)
local failing = coroutine.create(function()
error("boom", 0)
end)
observe(failing, "hata veren") --> hata veren hata boom
coroutine.resume(failing)
local cancelled = coroutine.create(function()
coroutine.yield()
end)
coroutine.resume(cancelled)
observe(cancelled, "iptal edildi") --> iptal edildi iptal edildi
coroutine.close(cancelled)resume
status
wrap