Skip to content

prodbysolivan/scheduler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Scheduler

High-performance loop lifecycle manager with priority-based task orchestration.

Description

A modular and platform-agnostic task manager for TypeScript. It uses an event-driven architecture to manage execution loops, allowing developers to group Tickable objects into Channels and process them based on explicit priority levels, ensuring deterministic and efficient execution across Web, Deno, Node.js, and Bun environments.

Dependencies

Installing

Add the package to your project directly via JSR:

deno add @prodbysolivan/scheduler

Quick Usage

Define your TickProvider and initialize the scheduler to start your loop:

import { Channel, NodeTickProvider, Scheduler } from "@prodbysolivan/scheduler";

const provider = new NodeTickProvider();
const scheduler = new Scheduler({ provider, tickrate: 60 });
const channel = new Channel({ id: "main-loop", priority: 10 });

channel.addToEntries({
  tick: (dt) => console.log(`Processing tick: ${dt}`),
});

scheduler.addToChannels(channel);
scheduler.start();

Help

For platform-specific issues (e.g., requestAnimationFrame vs setInterval), ensure you are passing the correct TickProvider implementation for your runtime environment. If tasks are not executing, verify that the Channel is enabled and the Scheduler has been started.

Authors

Solivan (prodbysolivan)

@solivan

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors