{"id":"lewisakura/pooler","name":"pooler","scope":"lewisakura","platform":"roblox","description":"Fast and easy to use instance pooler","version":"1.0.1","latest":"1.0.1","versions":["1.0.1"],"license":"MIT","licenseRating":"safe","licenseCaveats":[],"licenseVerified":true,"dependencies":{},"integrity":"1050146f0fad81c8f41f3d4d7481dad7773755211884a6d70a9f6ab205cb0a6e","likes":0,"downloads":0,"install":"forest install lewisakura/pooler","url":"https://forest.dev/p/roblox/lewisakura/pooler","files":"https://api.forest.dev/ai/package/roblox/lewisakura/pooler/files","readme":"# Pooler\n\nFast and easy to use instance pooler\n\n<!--moonwave-hide-before-this-line-->\n\n## Why use an instance pooler?\n\nTake the scenario of a bullet hell game. Think [Touhou](https://en.wikipedia.org/wiki/Touhou_Project). These games generally have a lot of objects:\n\n![bullets!!!](https://pbs.twimg.com/media/Dd57rC3UwAIHktD.jpg)\n\nIt's more performant to recycle these objects than destroy and recreate them. Whilst the differences are small, when the time it takes adds up,\nyour game will be a lot slower by removing and creating instances when compared to using an instance pooler.\n\n## Why use Pooler?\n\nPooler is designed to take any instance type and pool it. The majority of poolers I've seen can only accept parts and the ones I've seen that don't\ndo not have much customizability. I wrote Pooler to fill that gap for myself, and now I'm releasing it here.\n\nNeedless to say, Pooler is not perfect. There are many improvements that can be made, especially related to returning objects to the pool and what to\ndo on exhaustion. For the majority of tasks, however, Pooler is a suitable library that will handle thousands of objects easily.\n\n## Getting Started\n\nCreate your Pooler:\n\n```lua\nlocal template = Instance.new(\"Part\")\n\ntemplate.Anchored = true\n\ntemplate.Material = Enum.Material.Neon\ntemplate.BrickColor = BrickColor.Green()\n\nlocal pool = Pooler.new(template)\n```\n\nNow, you can fetch instances from it:\n\n```lua\nlocal instance = pool:Get()\n```\n\nOnce you're done with that instance, just (optionally) return it to the pool again:\n\n```lua\npool:Return(instance)\n```\n","readmeTruncated":false}