A little more of the planning of this...
It would be very slow and consume a ton of CPU if every time the front end asked for something it loaded a php file which checked a plugins folder, loaded all the plugins, found the plugin you needed and then asked it to process the command.
So after doing some research, I've realized that it IS possible to make a php daemon. Nice.
So now I'm thinking about using mysql as a middleman for information. This way, the php daemon will be constantly processing all information that needs to be updated frequently and storing the values in a mysql memory table for quick access.
There will be three memory tables. One will be for storing data that is updated quickly. One will be a client queue with a list of javascript commands for the client to run. They will have a datetime field to go along with them, so that if multiple clients are connected they can all get the "global" updates. There will be another table for server commands.
The main daemon will start by reading the plugins directory for plugins to this application and then make daemons for each of the plugins. As the daemons run, they constantly update the mysql tables.
The page generating javascript responses will then grab all the javascript commands from the memory tables and will additionally perform any tasks it was asked for by the client. In doing these tasks it gets any information it needs from the data table.
Again, rip me apart.



LinkBack URL
About LinkBacks
Reply With Quote




Bookmarks