Git Product home page Git Product logo

ted's Introduction

TED - Task Executing Distributor

Description

It's a small application which runs multiple tasks. A Task is an object which implements Runnable interface. TED manages multiple threads and queues tasks if required.

To communicate (add new task, get information about number of running/scheduled tasks) TED uses HTTP protocol:

  • GET /tasks/schedule?class=fully.qualified.class.Name - schedules new task
  • GET /tasks/count-scheduled - returns current number of scheduled tasks
  • GET /tasks/count-running - returns current number of running tasks

Building and running

After cloning the repository you can use SBT (Simple Build Tool) to build and run application. In the TED's main directory:

$ sbt run -Dhttp.port=8330

where 8330 is number of TCP/IP port on which TED will be listening.

To run the test go to the project's directory and:

$ sbt test

Example

There are already two examples tasks with fully qualified class names:

  • example.Itemize which prints every second one of the 5 popular JVM languages
  • example.Calculate which simulates calculations (long loop which does nothing)

For examlpe - to schedule the task Itemize run:

$ wget http://localhost:8330/tasks/schedule?class=example.Itemize

when TED is running. The 5 JVM languages will be printed in TED's console.

Number of threads

During the tests I realized that optimal number of running threads depends on the task type. For Itemize it was few thousand threads and for Calculate only tens (on my i7 machine). Maximal number of running threads is preset to 100. This constant can be modified in app/models/Scheduler.scala source file.

ted's People

Contributors

damgad avatar

Watchers

 avatar  avatar

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.