Skip to content

A simple ModuleScript, easy-to-use, statically typed, object pool for reusing Roblox Instances, reducing instantiation overhead.

License

Notifications You must be signed in to change notification settings

weenachuangkud/SimplePool-deprecated-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 

Repository files navigation

SimplePool (deprecated)

A simple ModuleScript, easy-to-use, statically typed, object pool for reusing Roblox Instances, reducing instantiation overhead.

Licesnse Under : MIT Licesnse

Copyright(c) 2025 Mawin CK

API :

How to Create SimplePool :

local SimplePool = require(PathTo.SimplePool)
local template : Insance = YourTemplateInstance

local Pool = SimplePool.new()

How to Prewarm(Clonings Template Instance) :

Pool:Prewarm(10)

How to Get And Return an Object (Notices: if you use Pool:GetObject() and Pool.Pool is Empty, it will Clone the Template and use the Template instead

local Obj = Pool:GetObject()
-- do something
Pool:ReturnObject(Obj)

How to Clear?

Pool:Clear()

How to Use Signals?

Pool.OnGetObject:Connect(function(obj)
    print(obj.Name .. " : GET")
end

Pool.OnReturnObject:Connect(function(obj)
    print(obj.Name .. " : RET")
end

About

A simple ModuleScript, easy-to-use, statically typed, object pool for reusing Roblox Instances, reducing instantiation overhead.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages