public void JobNestedAsyncRequests() { ManualResetEvent[] handles = new ManualResetEvent[] { new ManualResetEvent(false), new ManualResetEvent(false) }; // Nested async calls. Zencoder.CreateJob( "s3://bucket-name/file-name.avi", null, 3, "asia", true, false, r => { Assert.IsTrue(r.Success); Zencoder.JobDetails( r.Id, dr => { Assert.IsTrue(dr.Success); handles[0].Set(); }); }); // Async call then a sync call. Zencoder.CreateJob( "s3://bucket-name/file-name.avi", null, 3, "asia", true, false, r => { Assert.IsTrue(r.Success); Assert.IsTrue(Zencoder.JobDetails(r.Id).Success); handles[1].Set(); }); foreach (var handle in handles) { handle.WaitOne(); } }
public void JobJobDetailsRequest() { CreateJobResponse createResponse = Zencoder.CreateJob("s3://bucket-name/file-name.avi", null, null, null, true); Assert.IsTrue(createResponse.Success); JobDetailsResponse detailsResponse = Zencoder.JobDetails(createResponse.Id); Assert.IsTrue(detailsResponse.Success); AutoResetEvent[] handles = new AutoResetEvent[] { new AutoResetEvent(false) }; Zencoder.JobDetails( createResponse.Id, r => { Assert.IsTrue(r.Success); handles[0].Set(); }); WaitHandle.WaitAll(handles); }