Coder Social home page Coder Social logo

elementar's Introduction

    Elementar
    =========

    Very simple distributed background job executor based on Redis and the Redisson library.


    ---

    Add to your project:

    <!-- add the repository -->
    <repositories>
        <repository>
            <id>elementar-mvn-repo</id>
            <url>https://raw.github.com/gabrielhora/elementar/mvn-repo/</url>
            <snapshots>
                <enabled>true</enabled>
                <updatePolicy>always</updatePolicy>
            </snapshots>
        </repository>
    </repositories>

    <!-- add the dependency -->
    <dependency>
        <groupId>gsch</groupId>
        <artifactId>elementar</artifactId>
        <version>0.1.1</version>
    </dependency>


    The worker jar can be downloaded from https://raw.github.com/gabrielhora/elementar/mvn-repo/gsch/elementar/0.1.1/elementar-0.1.1-jar-with-dependencies.jar


    ---

    Define your jobs:

    class MyJob extends Job
    {
        public void run()
        {
            // do something here
        }
    }

    // create a new task manager and enqueue the job
    TaskManager taskManager = new TaskManager("localhost", 6379);
    taskManager.enqueue(new MyJob());


    Start the worker:

    You will need the elementar jar file and the your project's jar file (I recomend using
    a fat jar so you don't have to specify a huge classpath in the command line).
    You can scale out to as many workers as you want.

    $ java -cp \
        jar-with-your-jobs-and-dependencies.jar:elementar.jar \
        -Dredis_host=localhost \ # optional
        -Dredis_port=6379 \      # optional
        -Dinterval=1000 \        # optional
        -Dthreads=50 \           # optional
        gsch.Worker

elementar's People

Contributors

gabrielhora avatar

Stargazers

Shahid Khan avatar

Watchers

James Cloos 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.