parse-community / parse-php-sdk

The PHP SDK for Parse Platform
https://parseplatform.org/
Other
811 stars 346 forks source link

Adds jobs to ParseCloud #373

Closed montymxb closed 6 years ago

montymxb commented 6 years ago

Adds support for starting and monitoring cloud jobs. Jobs are like cloud functions, but instead of waiting for completion you immediately receive the id for a status object. The job status can be retrieved to see whether a cloud job has completed running, it's final status and other information about the job.

// start a cloud job
$jobStatusId = ParseCloud::startJob('MyCloudJob', [
    'arg' => 'value'
]);

// get job status by the returned id
$jobStatus = ParseCloud::getJobStatus($jobStatusId);

// check the status, can be succeeded/running/failed/etc.
$status = $jobStatus->get('status');

Includes tests & README refs.

codecov[bot] commented 6 years ago

Codecov Report

Merging #373 into master will increase coverage by <.01%. The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff            @@
##           master   #373      +/-   ##
========================================
+ Coverage   98.99%    99%   +<.01%     
========================================
  Files          38     38              
  Lines        3498   3522      +24     
========================================
+ Hits         3463   3487      +24     
  Misses         35     35
Impacted Files Coverage Δ
src/Parse/ParseCloud.php 100% <100%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 2b8ea3f...a37e12f. Read the comment docs.