Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add improvements to queues #492

Merged
merged 7 commits into from
Dec 2, 2018
Merged

Conversation

josephmancuso
Copy link
Member

@josephmancuso josephmancuso commented Dec 2, 2018

This adds an improvement to the queue drivers

You used to have to specify a job to pass through but now you can specify the callback on the fly or even specify a method directly:

class Something:

    def send(self):
        some_time_consuming_task()

and then run the queue:

def show(self, queue: Queue):
    queue.push(Something.send, args=('something', 'else'))

or specify a callback that should be used other than the handle method:

def show(self, queue: Queue):
    queue.push(Something, args=('something', 'else'), callback="send")

Not only will this allow us to queue random things on the fly but also allow certain things to be "queueable" like this:

class WelcomeEmail(..., ShouldQueue):
    ...

and then create new logic to queue it internally without having to pass it into the queue at all.

@josephmancuso josephmancuso added the next minor Issue scheduled for the next minor release label Dec 2, 2018
@josephmancuso josephmancuso self-assigned this Dec 2, 2018
@josephmancuso josephmancuso changed the title Add improvements to queus Add improvements to queues Dec 2, 2018
@coveralls
Copy link

coveralls commented Dec 2, 2018

Coverage Status

Coverage decreased (-0.06%) to 89.79% when pulling 544dcc6 on add-improvements-to-queus into 8a8db0f on develop.

@josephmancuso josephmancuso merged commit 13f2e69 into develop Dec 2, 2018
@josephmancuso josephmancuso deleted the add-improvements-to-queus branch December 23, 2018 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
next minor Issue scheduled for the next minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants