Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. `$worker = new Worker();
  2.  
  3. $class = new ApiaryController();
  4.  
  5. do {
  6.  
  7. $job = $worker->cache()->lpop('jobs:buy_cells');
  8.  
  9. if ($job) {
  10. $job = json_decode($job);
  11.  
  12. switch ($job->method)
  13. {
  14. case 'cell':
  15. $result = $class->cell($job);
  16. break;
  17. case 'honeycomb':
  18. $class->honeycomb($job);
  19. break;
  20. }
  21.  
  22. if(!empty($result) && isset($job->guid)) {
  23. $worker->cache()->setex('jobs:' . $job->guid, 3600, json_encode($result));
  24. }
  25. }
  26. } while ($exit_metka);`
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement