Signals & connectionsOverview
Connection.Defer
Represents deferred dispatch of a connection callback.
Details#
Schedules this connection's available handler with the supplied arguments. Keep the event alive until scheduled work can run. Function/Thread metadata may be absent for some connections.
Examples#
Example
local event = Instance.new("BindableEvent")
local own = event.Event:Connect(print)
local connection = getconnection(event.Event, 1)
if connection then
connection:Defer("deferred handler")
end
task.delay(1, function() own:Disconnect(); event:Destroy() end)