joakimk / toniq

Simple and reliable background job processing library for Elixir.
http://toniq.elixir.pm/
340 stars 25 forks source link

Job Priority #20

Open tlvenn opened 8 years ago

tlvenn commented 8 years ago

Hi,

Would it be possible to add a notion of job priority when enqueuing a job ? There are many use cases where this would be very useful.

Thanks.

joakimk commented 8 years ago

That would be a nice feature to have.

I'll certainly accept a pull request that adds it :)

As for how to do it, I don't know exactly. It would be somewhere in JobRunner.run_job.

tlvenn commented 8 years ago

Now that we have Erlang queue to deal with jobs, couldnt we just plug something like this https://github.com/okeuday/pqueue ?

joakimk commented 8 years ago

That could work. The tests should ensure adding such a thing does not break anything else.

I don't need it myself right now and I'm working on other projects on my spare time, but as I said, I will accept pull requests for this if anyone feels like adding it.