mardi 23 juin 2015

How to integrate AWS SWF using PHP so it can be managed from a user interface?

I'm using LAMP to build a CMS that allows administrators to upload an MP4 to an Amazon S3 Bucket, convert it several times using Elastic Transcoder, and update the local database so they can be delivered using Cloud Front.

Every step is now working as expected and a simple SWF workflow connects it all (as long as I launch the starter, decider and activity workers from the command line, as I've seen in the examples everywhere).

However, I'm struggling with connecting the pieces together with a user interface:

  1. Starting the workflow and launching the decider and activity workers using pcntl_exec when the user starts the upload is the right approach? Any alternatives?
  2. The activity workers and the deciders finish execution with every task so they have to be launched again for the next decision or activity, would the workflow starter responsible for launching workers every time or am I missing something?
  3. Providing 1. and 2. are going in the right direction, implementing feedback in the UI should be simple using AJAX calls to check the status of the record in the database, which would be updated in each one of the steps. Otherwise, any better way to do it?

Thanks in advance.




Aucun commentaire:

Enregistrer un commentaire