Git Product home page Git Product logo

weaver's Introduction

weaver v1.1.1

Priority-based task queues.

// General task queue
const weaver = require('weaver')

// Animation queue
const flux = require('weaver/flux')

// These will run in order (after a short delay).
flux.high(() => console.log('flux high'))
weaver.high(() => console.log('weaver high'))
flux.low(() => console.log('flux low'))
weaver.low(() => console.log('weaver low'))

// Image loader
const pixi = require('weaver/pixi')

// Preload an image.
const task = pixi.load('/foo.svg')

// Abort loading.
task.cancel()

Roadmap

  • Write more tests... ๐Ÿ‘€
  • flux.scroll(true) which puts all queues on hold

Questions and suggestions are encouraged! ๐Ÿ™‚

weaver's People

Contributors

aleclarson avatar

Watchers

 avatar  avatar

weaver's Issues

scroll: method for pausing all execution

Scrolling is often an expensive task. The scroll method would prevent all queues from being flushed, effectively pausing the async call stack.

scroll(true) indicates scrolling is happening.

scroll(false) indicates scrolling has completed.

It's undecided if a "scrolling count" should be tracked (to allow for multiple scrolling events).

avoid restarting a flush when pushing to current queue

Currently, if a function is queued while that queue is being flushed, the flush is restarted. Obviously, it would be nicer if the flush continued, and the queued function was called after any others in the same queue have been executed.

serial: method for blocking execution

The serial method will exist on tasks returned by any queue (eg: weaver.high).

Calling it will prevent other tasks from executing while that task is running.

It's undecided whether tasks before a serial task would postpone the execution of the serial task, or if it will run asap (as long as no other serial task precedes it).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.