Getting Started
Fluix is a single-module adaptive object pool. Install it, configure a Factory and Reset, and start pooling.
Installation
Get Fluix from the Roblox Creator Store:
Drop the module into ReplicatedStorage and require it:
local Fluix = require(ReplicatedStorage.Fluix)
No dependencies. No setup. One require.
Your First Pool
local Fluix = require(ReplicatedStorage.Fluix)
local BulletPool = Fluix.new({
Factory = function() return Bullet.new() end,
Reset = function(b) b:Reset() end,
MinSize = 32,
})
-- Pre-allocate before gameplay starts
BulletPool:Seed(20)
-- Acquire with an optional inline initialiser
local bullet = BulletPool:Acquire(function(b)
b.Position = spawnPos
b.Velocity = direction * speed
end)
-- Return when done
BulletPool:Release(bullet)
Signals
Every pool exposes lifecycle signals via VeSignal:
BulletPool.Signals.OnMiss:Connect(function(obj)
warn("Pool miss — consider raising MinSize or Headroom")
end)
BulletPool.Signals.OnAcquire:Connect(function(obj)
-- obj just left the pool
end)
Hot/Cold Tiers
Set HotPoolSize to maintain a small sub-pool of immediately-ready objects. Acquire drains hot first, then cold. Release refills hot first.
local Pool = Fluix.new({
Factory = function() return Part.new() end,
Reset = function(p) p.Parent = nil end,
MinSize = 64,
HotPoolSize = 8, -- keep 8 objects always warm
})
Cross-Pool Borrowing
On a factory miss, Fluix checks peer pools before allocating:
local BulletPool = Fluix.new({ Factory = ..., Reset = ... })
local FragPool = Fluix.new({ Factory = ..., Reset = ... })
-- Mutual borrowing
BulletPool:RegisterPeer(FragPool)
FragPool:RegisterPeer(BulletPool)
Lifecycle Control
pool:Pause() -- disconnect Heartbeat during a cutscene
pool:Resume() -- reconnect when gameplay resumes
pool:Drain() -- evict all pooled objects under memory pressure
pool:Destroy() -- destroy the pool entirely
Quick Reference
| I want to… | Method |
|---|---|
| Create a pool | Fluix.new |
| Pre-warm objects | pool:Seed |
| Get an object | pool:Acquire |
| Return an object | pool:Release |
| Return all live objects | pool:ReleaseAll |
| Check available count | pool:GetTotalAvailable |
| See all stats | pool:GetStats |
| See practical examples | Use Cases |