@yobo/queue
TypeScript icon, indicating that this package has built-in type declarations

2.0.1 • Public • Published

Queue

Package to call periodic callbacks within an interval given a time range.

API

  • start(options): String

    Receives an object with the options {startTime: String, endTime: String, interval: Number, action: function, onStart: function, onStop: function}, and the function to be called.

    Example:

    start({ 
      startTime: "09:00", 
      endTime: "23:30", 
      interval: 15, 
      action: () => console.log("Hello World!")
    });

    With this configuration, a queue is created, which prints Hello world every 15 minutes between 09:00-23:30 every day.

    Returns the queue id.

  • stop(id): Void

    Stops the queue with the given id.

  • updateOptions(id, options): Void

    Updates the options of the specified queue. Expects an object with at least one of the options used in start

Readme

Keywords

Package Sidebar

Install

npm i @yobo/queue

Weekly Downloads

1

Version

2.0.1

License

MIT

Unpacked Size

8.79 kB

Total Files

5

Last publish

Collaborators

  • estudio-yobo