Connect returns a handle with a single method:
The handle is a plain table, not an
RBXScriptConnection. It has Disconnect and
nothing else: no Connected property, no :Destroy(). It will not satisfy code or a
cleanup helper that expects a real Roblox connection object.Flux does not clean up after you
This matters most in three places.Per-character or per-round scripts
Per-character or per-round scripts
A
LocalScript under StarterCharacterScripts runs again on every respawn. Without
a disconnect, each life adds another listener and your callback runs once per life,
cumulatively.UI opened and closed repeatedly
UI opened and closed repeatedly
Connecting inside an
Open() function and never disconnecting in Close() leaks one
listener per open, along with every table the closure captured.Hot-reloaded modules
Hot-reloaded modules
Reloading a module that connects at require time stacks listeners on top of the
previous generation’s, and the old ones still hold references to stale state.
Patterns that hold up
Disconnect on destroying
Track a set of connections
Self-disconnecting listener
Useful when the condition to stop is known only inside the callback. This is also the workaround forOnce not returning a handle.
Once and Wait
cleans up automatically
A
Once listener removes itself from the listener list the moment it fires, so it
cannot leak. It returns no handle, though, so it also cannot be cancelled if the event
never arrives. A Once on an event that is never fired stays registered forever.cleans up automatically
A
Wait entry is removed when it resumes the parked thread. There is no timeout: if
the message never comes, the thread is never resumed and both the thread and its
listener entry stay alive for the session.What Flux does clean up
For completeness, these are the internal resources Flux manages on its own.Buffers larger than 64 KB are dropped rather than pooled, so a single oversized payload
does not permanently inflate the pool’s memory footprint.
Next steps
Known limits
Every rough edge in one place.
Batching
How and when buffers are actually flushed.
