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

wip queue implementation #1096

Closed
wants to merge 3 commits into from
Closed

wip queue implementation #1096

wants to merge 3 commits into from

Conversation

luceos
Copy link
Member

@luceos luceos commented Dec 29, 2016

this is a work in progress

Relates to #978 , please keep all discussion (not code review related) to the issue.

Daniel Klabbers added 3 commits December 29, 2016 11:37
Copy link
Contributor

@franzliedke franzliedke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be even simpler. :-)

use Symfony\Component\Translation\TranslatorInterface;

class EmailConfirmationMailer
{
use DispatchJobsTrait;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly, I don't think we need this trait, if all it does is shortening $this->queue->dispatch() to $this->dispatch(), at the cost of one more step to find out where this method is coming from, and why we need to inject the seemingly-unused $queue attribute. :)

Copy link
Member Author

@luceos luceos Feb 3, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might want to create an issue then to remove the need of a DispatchesEventTrait as well, it does exactly the same useless shortcut :) It might make more sense if the trait would have loaded the bound Dispatcher from my perspective.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be fair, that one at least encapsulates some logic ;)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Must have missed that 👍

$this->registerSyncConnector($manager);

return $manager;
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need the QueueManager at all,. Just configure the correct �queue.connection binding here, and we are good. Once we make this configurable (to switch between the default "sync" and other - real - drivers), this would just be a different instance, but it would be configured here,

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@franzliedke so you want me to only set up the default connection and then call the QueueServiceProvider of Illuminate?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. Only register the connection instance. We don't need a manager at all, I think, because we don't need the dynamic switching between different connections.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For simplicity purposes we can go that direction. Although I would know of situations where an extension might be happy to use separate queue drivers. Ok, thanks!

@franzliedke
Copy link
Contributor

Good job on this! 👏

Just some minor things...

@tobyzerner
Copy link
Contributor

Why can't we use Laravel Mailer's built-in queue functionality? https://laravel.com/docs/5.3/mail#queueing-mail

@franzliedke
Copy link
Contributor

Because we're not on 5.3 yet. ;)

@tobyzerner
Copy link
Contributor

It exists in 5.1, with a different API: https://laravel.com/docs/5.1/mail#queueing-mail

@tobyzerner
Copy link
Contributor

My concern is that this proposed MailJob API is very restricted (you can't customise the Message object), and once we start trying to open it up, we'll essentially be duplicating Laravel's API unnecessarily?

@luceos
Copy link
Member Author

luceos commented Feb 15, 2017

@tobscure with all respect, I think we need to implement a queue initially. Moving towards mailable makes a lot of sense, but - in my opinion - would be step 2 and can be easily done once @sijad is done with his compatibility towards 5.3+. I picked the mail sending initially, because that one is blocking api request.

@luceos
Copy link
Member Author

luceos commented May 15, 2017

@flarum/core Should we hold this off until @sijad has finished the upgrade to L 5.3 or 5.4 or 5.5?

@luceos luceos closed this Sep 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants