Page MenuHomePhorge

Use an Enum for a list of queues
AcceptedPublic

Authored by machniak on Wed, Mar 12, 11:56 AM.

Details

Reviewers
mollekopf
Group Reviewers
Restricted Project
Summary

And a better way of defining queue for a job

Test Plan

./phpunit

Diff Detail

Repository
rK kolab
Branch
dev/queue-enum
Lint
Lint Skipped
Unit
No Test Coverage
Build Status
Buildable 52816
Build 18736: arc lint + arc unit

Event Timeline

machniak created this revision.
mollekopf subscribed.

Nice cleanup.

I don't understand why we no longer need $this->onQueue(self::QUEUE); ? Clearly seems to work in the tests, so there's apparently something making it work.

This revision is now accepted and ready to land.Wed, Mar 12, 12:38 PM

I don't understand why we no longer need $this->onQueue(self::QUEUE); ? Clearly seems to work in the tests, so there's apparently something making it work.

The property is not documented, so my previous implementation was based on onQueue(). However, I've found that public $queue property exists in Illuminate\Bus\Queueable trait. Because it's public I hope it will not change in the future. The tests only assert the queue value, so it's probably not enough, but I tested manually that e.g. mail jobs are put into the 'mail' queue, so it's working.

I'll look into making proper assertion on the queue using Queue::assertPushedOn().