GithubHelp home page GithubHelp logo

Comments (11)

fbjork avatar fbjork commented on July 28, 2024

Can't wait to see some progress on this! Qu is great so far, but still needs some additional features to become awesome.

from qu.

bkeepers avatar bkeepers commented on July 28, 2024

@fbjork Thanks, I hope to make some progress en route to RubyConf this week. Please do let me know what other features you think would make it awesome!

from qu.

luislavena avatar luislavena commented on July 28, 2024

Hello,

If I can comment, I think there are two approaches to this:

a in-memory backend that performs the enqueued job right away after enqueued,

Or, a kind of worker that do not trap signals or anything.

As example, for Resque we ended creating the following:

module Helpers
  def do_delayed_work!
    worker = SpecWorker.new('*')
    worker.work
  end
end

class SpecWorker < Resque::Worker
  def work(interval = 5, &block)
    while job = reserve
      working_on job
      perform(job, &block)
      done_working
    end
  end
end

Which is far from being pretty, but allowed us to execute the enqueued jobs.

Just my two cents.

BTW: great work on Qu, really loving it!

from qu.

bkeepers avatar bkeepers commented on July 28, 2024

@luislavena great suggestions. You can use the existing worker to work off jobs in tests and it won't trap signals:

Qu::Worker.new('queue1', 'queue2').work_off

I was thinking I would implement test mode using hooks and work off the job after it is enqueued. I'm leaning toward this solution because it still goes through the whole stack and will make sure the args are serializable/deserializable.

from qu.

luislavena avatar luislavena commented on July 28, 2024

I was thinking I would implement test mode using hooks and work off the job after it is enqueued. I'm leaning toward this solution because it still goes through the whole stack and will make sure the args are serializable/deserializable.

Great approach, however there should be a way to control it. Under certain specs I would not like any job being performed.

Also, wouldn't Qu.enqueue and Qu::Worker.new(...).work_off exercise the args serialization?

from qu.

bkeepers avatar bkeepers commented on July 28, 2024

Yep, enqueue and work_off would do it. That's how our tests for speakerdeck.com currently work.

On Sep 30, 2011, at 8:49 AM, Luis [email protected] wrote:

I was thinking I would implement test mode using hooks and work off the job after it is enqueued. I'm leaning toward this solution because it still goes through the whole stack and will make sure the args are serializable/deserializable.

Great approach, however there should be a way to control it. Under certain specs I would not like any job being performed.

Also, wouldn't Qu.enqueue and Qu::Worker.new(...).work_off exercise the args serialization?

Reply to this email directly or view it on GitHub:
#6 (comment)

from qu.

fbjork avatar fbjork commented on July 28, 2024

I suggest going with an in memory approach to avoid writing to Redis and adding jobs to the development queues. If not perhaps the jobs should be namespaced with the environment, i.e 'development-my_queue' or something along those lines.

from qu.

sumskyi avatar sumskyi commented on July 28, 2024

how about https://gist.github.com/1391531 approach?

from qu.

bkeepers avatar bkeepers commented on July 28, 2024

@sumskyi: looks like a good start to me. Want to submit a pull request with it?

from qu.

sumskyi avatar sumskyi commented on July 28, 2024

@bkeepers: added #36

from qu.

bkeepers avatar bkeepers commented on July 28, 2024

Awesome, thanks!

from qu.

Related Issues (20)

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.