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

[Subscriptions] Queue "new post" email #1869

Closed
franzliedke opened this issue Sep 4, 2019 · 6 comments · Fixed by flarum/subscriptions#21 or #1931
Closed

[Subscriptions] Queue "new post" email #1869

franzliedke opened this issue Sep 4, 2019 · 6 comments · Fixed by flarum/subscriptions#21 or #1931
Assignees
Milestone

Comments

@franzliedke
Copy link
Contributor

Relates to #978.

A nice first use-case for playing around with our new queueing support (#1773).

  1. Send new_post email via queue (which uses the sync driver by default, so this should not change behavior).
  2. Document the setup for real queue workers using e.g. Redis, and try it out on discuss.

Once this is implemented, we can start showcasing this to extension developers, and tackle other tasks in the system that could benefit from being offloaded to the queue.

@franzliedke franzliedke added this to the 0.1.0-beta.11 milestone Sep 4, 2019
@STotev
Copy link

STotev commented Sep 15, 2019

I've read both the #978 issue and PR conversation as well as the code(multiple times) and still wondering what's the idea of this? Why just not using the original laravel queuing system?

Would've been easier to just have a configuration of what queue type to be used. If the shared hosting doesn't support background workers, the config can remain sync.

Am I missing something that I can't explain myself or... ?

@luceos
Copy link
Member

luceos commented Sep 16, 2019

We are actually using the Laravel Queue, but without any configs (per se). What Flarum relies on more heavily is the ability to replace bindings in the service container. There are several reasons for this:

  • we rather allow admins to configure things in the admin area, not in configuration files
  • we hope to limit the file size of a full Flarum install by not loading all direct dependencies (drivers)

I used to be skeptic too, mind you, but I think doing it like this makes sense for a product like Flarum.

Here's an example how I am implementing a Redis based Queue (I need it for the horizon extension to work):

https://github.com/Bokt/flarum-redis/blob/bc8a25776e02de1c5284dd6011e0aa96aeea542c/src/Provides/Queue.php#L15-L26

@STotev
Copy link

STotev commented Sep 18, 2019

I guess I am missing some internal knowledge about Laravel and components and makes me confused of what is going on.
To be honest. I've never worked on a project that strips off a huge part of Laravel.

I need to dig a bit longer to get better understanding of the internals but I will still be happy to try and work on this so I can get deeper understanding of Flarum as well.

Anyone else could work on this as well. I am taking this mostly for learning purposes.

@luceos is your Redis approach going to be implemented in Flarum?

@franzliedke
Copy link
Contributor Author

AFAIK, bokt/flarum-redis is the current playground for what will probably move into core.

As @luceos already explained, there is not much gain in offering all the adapters and functionalities that Laravel brings to the table in Flarum. We mostly use Laravel (its components, really) as a library, not so much as a framework. Laravel wants to offer a lot to many different types of applications; we have very specific requirements and goals, thus we don't need it all.

My current vision is for Flarum to support a fallback and a "real" driver for queueing. The latter will probably be based on Laravel's Redis queue.

@franzliedke franzliedke pinned this issue Sep 23, 2019
@gwillem

This comment has been minimized.

@dsevillamartin

This comment has been minimized.

dsevillamartin added a commit to flarum/subscriptions that referenced this issue Oct 5, 2019
@luceos luceos self-assigned this Nov 13, 2019
@franzliedke franzliedke unpinned this issue Nov 15, 2019
@luceos luceos modified the milestones: 0.1.0-beta.11, 0.1.0-beta.12 Nov 26, 2019
@luceos luceos modified the milestones: 0.1.0-beta.12, 0.1.0-beta.13 Feb 24, 2020
luceos pushed a commit to flarum/subscriptions that referenced this issue Apr 1, 2020
askvortsov1 pushed a commit to flarum/subscriptions that referenced this issue Mar 11, 2022
askvortsov1 pushed a commit to flarum/subscriptions that referenced this issue May 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants