Connection:Defer Asynchronous

Queue this inspected listener’s callback with task.defer. Choose this when the callback should run after the current resumption cycle.

Syntax
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.

Function parameters
ParameterTypeDescription
...argsanyArguments 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

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()
Kawaii documentation