Giter VIP home page Giter VIP logo

memcachedb_q's Introduction

MemcacheDB Que system.

example for adding a runner to the que

que = MemcachedbQ.new(:notices) #uses the :notices que
que.add_runner(:notifier, :deliver_customer_order, order.id) #adds a runner
    # in this case :notifier relates to an actionmailer class
    # :deliver_customer_order is a method within that class
    # and the order.id is the value passed along to that method.
    # at this point the information should be in the memcachedb
    # if for some reason adding the runner fails it should 
    # immediately run the class.method(value) combination
que.run
    # que.run is used to fork a process to handle the specific :notices runner que
    # it checks before forking if there is anything to run, or if a process
    # is already running a forked que for notices
    # also instead of using que.run, you can just run the rake task to handle all
    # runners in the config file. the simplest way is to setup a cronjob to run
    # every minute. At the most you will only have as many forked processes as 
    # there are ques


added option to repeat runners.

que.add_runner(:notifier, :deliver_customer_order, order.id, :repeats=>30)

:repeats is in seconds
must use :repeat_name for repeats

this will add a new runner just before running the existing job. If you originally set a time to run then it will add to that time with repeats. If no :run_time was set it will set a run time of Time.now when it runs for the first time.

memcachedb_q's People

Contributors

kellymahan avatar

Stargazers

 avatar  avatar

Watchers

 avatar  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.