0

I am using following nodejs code to retrieve operation instance of video annotation request

var vidOptions = {
        "inputUri": gCloudURL,
        "features": [ 'LABEL_DETECTION' ]
        };
    client.annotateVideo(vidOptions).then(function(results){
        //console.log(results[0].name);
        //return JSON.stringify(results[0].name);
        const operation = results[0];
        res.json(operation);
        //console.log('Waiting for operation to complete...');
        //return operation.promise();
        })

But once I have operation name which function / library i need to call to get operation status and results. Videos might be lnong duration. Hence I dont want to rely on promise. Rather in 1st Call I initiate video annotation. In 2nd call I run a for loop and keep checking if videoannotation operation is finished?

BTW AWS rekognition rocks when it comes to this, they allow integration with SNS so you automatically recieve an event when video processing finishes and you avoid all overhead of polling from client side. Doesnt GCP has similar feature?

Tarun
  • 517
  • 4
  • 9
  • 24

1 Answers1

0

It is pretty much as you've mentioned it.

Because asynchronous operations are aimed for big amounts of data, they have no defined operation time and they don't automatically notify you when they are finished.

A task poll checking for the "done=true" value should be implemented to review the status periodically.

Ggrimaldo
  • 327
  • 1
  • 7