{"id":"emdomanus/tempo","name":"tempo","scope":"emdomanus","platform":"roblox","description":"A low-overhead phase-aware scheduler for Roblox.","version":"0.1.0","latest":"0.1.0","versions":["0.1.0"],"license":"MIT","licenseRating":"safe","licenseCaveats":[],"licenseVerified":true,"dependencies":{"emdomanus/hook":{"version":"^0.1.0","alias":"hook"}},"integrity":"e61ac6a46dbc4e1baca1be6573884a2ca09ce9366b5f8d77862ad935ba355e51","likes":0,"downloads":0,"install":"forest install emdomanus/tempo","url":"https://forest.dev/p/roblox/emdomanus/tempo","files":"https://api.forest.dev/ai/package/roblox/emdomanus/tempo/files","readme":"# Tempo\n\nTempo is a phase-aware scheduler for Roblox.\n\nIt is built around explicit phase tokens, numeric task ids, pooled records, Hook-backed phase subscribers, and per-phase heaps. The library does not connect itself to `RunService`; callers bind phases to whatever driver they want.\n\n```lua\nlocal RunService = game:GetService(\"RunService\")\nlocal Tempo = require(ReplicatedStorage.packages.tempo)\n\ntype VmmoPhase = \"preRender\"\n\nlocal tempo: Tempo.TempoHandle<VmmoPhase> = Tempo.new()\nlocal heartbeat = tempo.phases.heartbeat\nlocal preRender = tempo:addPhase(\"preRender\")\n\nRunService.Heartbeat:Connect(tempo:evaluatePhase(heartbeat))\nRunService.PreRender:Connect(tempo:evaluatePhase(preRender))\n\nlocal id = tempo:delay(0.25, function(now)\n\tprint(\"ran\", now)\nend, preRender)\n\ntempo:rescheduleIn(id, 0.1)\ntempo:cancel(id)\n```\n\n`heartbeat` is the only native phase. Custom phases are supplied by the caller through the `TempoHandle<PhaseT>` type.\n\nUse phase tokens in hot paths. String phase names are accepted for convenience, but tokens avoid repeated name lookup.\n","readmeTruncated":false}