wp-background-processing icon indicating copy to clipboard operation
wp-background-processing copied to clipboard

Consider using queue interprop as abstraction for queues

Open makasim opened this issue 6 years ago • 1 comments

Hello!

Please look at https://github.com/queue-interop/queue-interop project. Using interfaces from it allows us reuse some implementations like enqueue, which supports a lot of transports. You can outsource some code

makasim avatar Jan 26 '18 14:01 makasim

Thinking about this, what do you think the minimum viable implementation would be?

Do you mean just to split WP_Background_Process into few classes, each implementing one of these:

  • a Queue to store the queued items in the db
  • a Producer to be able to add items to the queue
  • a Consumer to be able to retrieve and process those items

Are there any other interfaces needed?

Or do you mean WP_Background_Process would become a Context implementation and the dev working with WP_Background_Process would become responsible to create suitable Queues, Producers and Consumers (probably providing some defaults or in case of the Consumer an abstract class, where the actual processing can be defined in a child just like right now the WP_Background_Process::task() abstract method).

How could the project make sure that it continues to work in a standalone way as well, when there is no MQ implementation available for the WP site?

Could you please elaborate a bit on your ideal design for this idea?

BenceSzalai avatar Jul 11 '20 12:07 BenceSzalai

Closing ancient issue. :smile:

ianmjones avatar Apr 11 '23 17:04 ianmjones