Skip to main content

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:

Get Fluix on 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 poolFluix.new
Pre-warm objectspool:Seed
Get an objectpool:Acquire
Return an objectpool:Release
Return all live objectspool:ReleaseAll
Check available countpool:GetTotalAvailable
See all statspool:GetStats
See practical examplesUse Cases