{"id":18809903,"url":"https://github.com/bytebit-org/roblox-stacksandqueues","last_synced_at":"2026-01-10T12:30:20.035Z","repository":{"id":57683531,"uuid":"473465926","full_name":"Bytebit-Org/roblox-StacksAndQueues","owner":"Bytebit-Org","description":"A simple set of implementations of stack and queue data structures.","archived":false,"fork":false,"pushed_at":"2022-04-05T05:18:56.000Z","size":294,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-01T02:47:07.407Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Bytebit-Org.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-03-24T05:14:42.000Z","updated_at":"2022-06-20T05:51:28.000Z","dependencies_parsed_at":"2022-09-05T17:31:12.338Z","dependency_job_id":null,"html_url":"https://github.com/Bytebit-Org/roblox-StacksAndQueues","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bytebit-Org%2Froblox-StacksAndQueues","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bytebit-Org%2Froblox-StacksAndQueues/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bytebit-Org%2Froblox-StacksAndQueues/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bytebit-Org%2Froblox-StacksAndQueues/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Bytebit-Org","download_url":"https://codeload.github.com/Bytebit-Org/roblox-StacksAndQueues/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239743900,"owners_count":19689563,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T23:18:08.489Z","updated_at":"2025-02-19T22:26:08.405Z","avatar_url":"https://github.com/Bytebit-Org.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Stacks and Queues\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/Bytebit-Org/roblox-StacksAndQueues/actions\"\u003e\n      \u003cimg src=\"https://github.com/Bytebit-Org/roblox-StacksAndQueues/workflows/CI/badge.svg\" alt=\"CI status\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"http://makeapullrequest.com\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/PRs-welcome-blue.svg\" alt=\"PRs Welcome\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://opensource.org/licenses/MIT\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/License-MIT-blue.svg\" alt=\"License: MIT\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://discord.gg/QEz3v8y\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/discord-join-7289DA.svg?logo=discord\u0026longCache=true\u0026style=flat\" alt=\"Discord server\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\nStacks and Queues is a simple set of implementations of stack and queue data structures.\n\n## Installation\n### roblox-ts\nSimply install to your [roblox-ts](https://roblox-ts.com/) project as follows:\n```\nnpm i @rbxts/stacks-and-queues\n```\n\n### Wally\n[Wally](https://github.com/UpliftGames/wally/) users can install this package by adding the following line to their `Wally.toml` under `[dependencies]`:\n```\nStacksAndQueues = \"bytebit/stacks-and-queues@1.0.5\"\n```\n\nThen just run `wally install`.\n\n### From model file\nModel files are uploaded to every release as `.rbxmx` files. You can download the file from the [Releases page](https://github.com/Bytebit-Org/roblox-StacksAndQueues/releases) and load it into your project however you see fit.\n\n### From model asset\nNew versions of the asset are uploaded with every release. The asset can be added to your Roblox Inventory and then inserted into your Place via Toolbox by getting it [here.](https://www.roblox.com/library/9181293671/Stacks-and-Queues-Package)\n\n## Documentation\nDocumentation can be found [here](https://github.com/Bytebit-Org/roblox-StacksAndQueues/tree/master/docs), is included in the TypeScript files directly, and was generated using [TypeDoc](https://typedoc.org/).\n\n## Example\nThis example uses a `Queue` to track incoming tasks and attempts to process one every `RunService.Heartbeat` event.\n\n\u003cdetails\u003e\n  \u003csummary\u003eroblox-ts example\u003c/summary\u003e\n\n  ```ts\n  import { Queue } from \"@rbxts/stacks-and-queues\";\n  import { RunService } from \"@rbxts/services\";\n\n  type Task = {}; // some task type\n\n  export class TaskProcessor {\n    private readonly queue = new Queue\u003cTask\u003e();\n\n    public constructor() {\n      this.listenForHeartbeats();\n    }\n\n    public queueTask(task: Task) {\n      this.queue.push(task);\n    }\n\n    private listenForHeartbeats() {\n      RunService.Heartbeat.Connect(() =\u003e {\n        if (this.queue.isEmpty()) {\n          return;\n        }\n\n        this.processTask(this.queue.pop());\n      });\n    }\n\n    private processTask(task: Task) {\n      // some processing stuff\n    }\n  }\n  ```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eLuau example\u003c/summary\u003e\n\n  ```lua\n  local RunService = game:GetService(\"RunService\")\n\n  local Queue = require(path.to.modules[\"stacks-and-queues\"]).Queue\n\n  local TaskProcessor = {}\n  TaskProcessor.__index = TaskProcessor\n\n  function new()\n    local self = {}\n    setmetatable(self, TaskProcessor)\n\n    self._queue = Queue.new()\n\n    _listenForHeartbeats(self)\n\n    return self\n  end\n\n  function TaskProcessor:queueTask(task)\n    self.queue:push(task)\n  end\n\n  function _listenForHeartbeats(self)\n    RunService.Heartbeat:Connect(function\n        if (self.queue:isEmpty()) then\n          return\n        end\n\n        _processTask(self, self.queue:pop())\n      end)\n  end\n\n  function _processTask(self, task)\n    -- some processing stuff\n  end\n\n  return {\n    new = new\n  }\n  ```\n\u003c/details\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbytebit-org%2Froblox-stacksandqueues","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbytebit-org%2Froblox-stacksandqueues","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbytebit-org%2Froblox-stacksandqueues/lists"}