task-scheduler

    0.0.1 • Public • Published

    Task Scheduler

    Build Status

    Work in progress

    Task Scheduler Server to schedule or run scripts/applications/commands which:

    • scales. Server consists of a master task queue process and the workers.
    • has web interface
    • has RESTful API
    • has websockets
    • has database persistance

    Time Triggers

    Describe with:

    • RRule
    • Cron
    • One time triggers:
      • Date instance
      • relative to the current time, like in 2 hours and 20 minutes

    Executors

    • source: { src: 'tasks/foo.js' }
    • command: { command: 'wget -i file' }
    • request: { url: 'http://foo.com/baz', method: 'POST', data: {}}

    CLI

    $ npm i -g task-scheduler
    $ tasksched --help
     
    # Server 
    $ tasksched server --help
    # - start the server 
    $ tasksched server start
    # - stop the server 
    $ tasksched server stop
     
    # Application 
    $ tasksched app --help
    # - create the application. Tasks are bound to the app after the authorization 
    $ tasksched app create --name Foo --password BazPass
    # ... for more infos, see the help action 
     
    # Task 
    $ tasksched task --help
    # - create the task 
    $ tasksched task create --name FooName --trigger "in 20 minutes" --exec.src baz.js
    # ... for more infos, see the help action 

    Web Interface

    Start the server $ tasksched server start and navigate to http://localhost:5888/

    Client module

        var client = require('task-scheduler-client');
        client
            .ensureTask({
                name: 'sync data',
                trigger: 'FREQ=DAILY;BYHOUR=23',
                exec: {
                    src: '/tasks/sync-data.js'
                }
            })
            .done(onSuccess) //> created
            .fail(onError)   //> task creation failed
            ;

    If the task with the same name, same trigger and exec already exists, it will do nothing.


    (c) MIT - The Atma.js Project

    Keywords

    none

    Install

    npm i task-scheduler

    DownloadsWeekly Downloads

    1

    Version

    0.0.1

    License

    MIT

    Last publish

    Collaborators

    • avatar