Connection: Defer Asynchronous
Queue this inspected listener’s callback with task.defer. Choose this when the callback should run after the current resumption cycle.
Luau
Connection:Defer(...args: any) -> ()Parameters
Call this method with a Connection receiver. The colon supplies self implicitly; a dot call must pass the receiver explicitly.
| Parameter | Type | Description |
|---|---|---|
...args | any | Arguments passed directly to the selected callback. |
Returns
()No values.
Usage notes
Only the chosen callback is scheduled. This does not emit the original event, and a one-shot listener is disconnected before it runs.
Example
Luau
local event = Instance.new("BindableEvent")
event.Event:Connect(function(value) print("Deferred", value) end)
local connection = getconnection(event.Event, 1)
if connection then connection:Defer(42) end
task.wait()
event:Destroy()