modzyClient.blockUntilComplete

Waits until the job move to a final state

modzyClient.blockUntilComplete(Job job, long timeout)

This method blocks the job execution until the job changes its status (to COMPLETED, TIMEDOUT or CANCELED), or reaches the timeout seconds. It refreshes the job information for each model_run_timeout/20.

Parameters

ParameterTypeDescriptionExample
jobJobAn existing job objectJob job = modzyClient.submitJob("ed542963de", "1.0.1", jobInput, false);
timeoutlongMilliseconds to wait until timeout.60*1000

Returns

com.modzy.sdk.model.Job object with the job status obtained from the server

Examples

Job job = modzyClient.getJobClient().getJob("14856eb1-0ad8-49e7-9da3-887acb80fea5");
job = modzyClient.blockUntilComplete(job, null);
System.out.println(String.format(" %s", job));