Class SaeDeferredJob
SAE DeferredJob
大文件导入导出服务
<?php $dj = new SaeDeferredJob(); //添加任务 $taskID=$dj->addTask("import","mysql","bucketA","abc.sql","databaseA","tableA","callback.php"); if($taskID===false) var_dump($dj->errno(), $dj->errmsg()); else var_dump($taskID); $taskID=$dj->addTask("export","mysql","bucketB","abc.csv.zip","databaseB","tableB","csv.php", true); if($taskID===false) var_dump($dj->errno(), $dj->errmsg()); //获得任务状态 $ret=$dj->getStatus($taskID); if($ret===false) var_dump($dj->errno(), $dj->errmsg()); //删除任务 $ret=$dj->deleteTask($taskID); if($ret===false) var_dump($dj->errno(), $dj->errmsg()); ?>
错误码参考 - errno: 0 成功 - errno: -1 参数错误 - errno: -2 数据库错误 - errno: -3 没有找到taskid - errno: -4 已经删除过的taskid - errno: -5 任务已经开始执行 - errno: -6 超过每天可执行任务数量上限 - errno: -7 系统错误 - errno: -8 未知错误
- SaeObject
- SaeDeferredJob
public
|
|
public
integer
|
|
public
string
|
|
public
mix
|
|
public
mix
|
|
public
boolean
|