Drupal python background server
Just perfect for managing actions that require long, cpu or filesystem intensive operations such as encrypting, building a file, or even interfacing with other hardware/usb/bluetooth etc etc
This is born out of the need to have a workflow actions trigger where those actions execute independently of the main Drupal/PHP thread (as PHP does not offer any form of threading).Effectively you are making an asychronous call to trigger a new thread for each request in the python daemon (which returns immediately to allow your drupal application to continue executing) in the python layer from the PHP layer via XML-RPC and drupal actions.
Fortunately the serialized node object from drupal, and python's un-serialize are compatible! so you can send your node to your python layer via XML-RPC with no fuss.
Finally, the python layer communicates back with the PHP layer to inform the PHP/Drupal that the action is complete and to transition the workflow.
See attached code, includes drupal module and python backend server.
| Attachment | Size |
|---|---|
| drupal_background.tgz | 5.84 KB |
