-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
395ece9
commit c84587c
Showing
3 changed files
with
97 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
<?php | ||
|
||
namespace WP_Queue\Connections; | ||
|
||
use Exception; | ||
use WP_Queue\Job; | ||
|
||
class SyncConnection implements ConnectionInterface { | ||
/** | ||
* Push a job onto the queue. | ||
* | ||
* @param Job $job | ||
* @param int $delay | ||
* | ||
* @return bool|int | ||
*/ | ||
public function push(Job $job, $delay = 0) { | ||
$job->handle(); | ||
|
||
return true; | ||
} | ||
|
||
/** | ||
* Retrieve a job from the queue. | ||
* | ||
* @return bool|Job | ||
*/ | ||
public function pop() { | ||
return false; | ||
} | ||
|
||
/** | ||
* Delete a job from the queue. | ||
* | ||
* @param Job $job | ||
* | ||
* @return bool | ||
*/ | ||
public function delete($job) { | ||
return false; | ||
} | ||
|
||
/** | ||
* Release a job back onto the queue. | ||
* | ||
* @param Job $job | ||
* | ||
* @return bool | ||
*/ | ||
public function release($job) { | ||
return false; | ||
} | ||
|
||
/** | ||
* Push a job onto the failure queue. | ||
* | ||
* @param Job $job | ||
* @param Exception $exception | ||
* | ||
* @return bool | ||
*/ | ||
public function failure($job, Exception $exception) { | ||
return false; | ||
} | ||
|
||
/** | ||
* Get total jobs in the queue. | ||
* | ||
* @return int | ||
*/ | ||
public function jobs() { | ||
return 0; | ||
} | ||
|
||
/** | ||
* Get total jobs in the failures queue. | ||
* | ||
* @return int | ||
*/ | ||
public function failed_jobs() { | ||
return 0; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters