Concurrent Execution #72
sclubricants
started this conversation in
Ideas
Replies: 1 comment
-
If you're on PHP >= 8.1 you should definitely look into Fibers!
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm interested in this project but I'm not sure it would work for what I need.
I created a rough scheduler but the scheduling part is not very good. However I really like the execution part.
I do a lot of ETL operations on databases. In my case I need to updated several tables, then maybe call some database functions to compute some things and then load the data into another system. I created controller for each command that process one table at a time or other action. Then I assemble all the command strings and use brackets to group commands I want to run in parallel.
For example:
runParallelCmds() is called in a loop of a list of jobs. Once all subjobs complete then next job will execute.
A process file is created for each parallel command. each command outputs json response with status. when pid is filled with response then status is set. Once all jobs have status or timeout the infinite loop breaks. The code isn't very elegant but it does the job. One day php will have multi threading :)
The speed at which jobs process is immensely improved!
Any chance on creating similar functionality with this project?
Beta Was this translation helpful? Give feedback.
All reactions