-
Notifications
You must be signed in to change notification settings - Fork 28
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
Discussion - Asynchronous Actions #58
Comments
My first thought is that it's out of scope for BerlinDB and is better implemented separately, such as via integrating with wp-background-processing or Gearman etc. Click a button, that fires off a background task, and the callback of that task uses BerlinDB. But the actual part that makes it asynchronous isn't BerlinDB itself. But if you feel otherwise then I'd love to hear the reasoning. |
Well, I suppose the thought that crossed my mind was that there could be another argument on query actions (delete, add_item) that could basically say “do this action asynchronously”. It would gather up all the async tasks, and do them in a separate thread, perhaps it’s fired on php shutdown. I don’t think it would be intended to be a be-all-end-all solution to async, not at all. I do think it could provide a down-and-dirty, accessible way to make Berlin run faster on some implementations. I’m definitely on the fence, but I also lean toward “out of scope”. I’m pretty inexperienced with async php, so I don’t fully understand the nuance well enough to get the implications I’m making. |
I figured it could work via |
WordPress doesn't make it easy to implement asynchronicity, due to everything being completely dependent on the HTTP request. There are a few different ways of doing async in PHP these days, but I wouldn't call it popular or easy. This will likely require a lot of work. Berlin will theoretically be more easily adapted into an asynchronous framework once #39 happens. Tend to agree that it's somewhat out of scope for core Berlin, but all of the core code should at least be async-friendly as we go! |
Yep, okay I'm in on that. Even if we build something in, it may prevent other async systems from working properly. Okay, I'm going to go ahead and close this. |
I really wish it were possible to do asynchronous actions in BerlinDB. There are numerous instances in-which a process does not need to wait for a database change to happen to continue.
A simple example is deleting related data from other related tables, such as metadata.
There are also less-common scenarios where the system needs to save data, but does not need to use that record right away.
I recognize that PHP doesn't have any true async capabilities like Javascript, but perhaps we could set something up that runs a set of operations in a separate request.
I'm writing this with the intent to discuss different ways to approach this, identify pitfalls, and even identify if this sort of thing should be in BerlinDB at all.
The text was updated successfully, but these errors were encountered: