I have a drupal app that needs to publish out some of it's content - there is a flash wysiwyg front end that communicates with a drupal backend through the services module. The user can upload images / video, places and manipulates them in flash, and when they are done will export out a static version. As part of this export process the app needs to do some processing on the media elements - rescaling &etc, so I have made use of the batch api so it only processes on element at a time to stop timeouts and so forth. This mostly works ok, but I am getting unstuck by the way batchapi seems to work. What I am trying to do is this:
- The flash tool calls the export service
- The export service creates a node that represents this export, and returns a node_id
- The export service fires off the export in the background, once it's done it changes a status in the node
- Meanwhile the flash tool polls the app to see when the publish is done, and notfies the user.
What seems to be getting me unstuck at the moment is firing off the batch process in the background, without triggering the redirect thing that batch does when I call batch_process()
, so that I can return the node id to flash and initiate off the batch at the same time.
Hopefully that makes sense - any suggestions / ideas? Or am I Doing It Wrong?