2016-09-03 15:36:57 +00:00
|
|
|
<?php
|
|
|
|
|
2024-02-19 00:30:12 +00:00
|
|
|
namespace Wallabag\Consumer;
|
2016-09-03 15:36:57 +00:00
|
|
|
|
2016-09-09 19:02:03 +00:00
|
|
|
use Simpleue\Job\Job;
|
2016-09-03 15:36:57 +00:00
|
|
|
|
2016-09-11 18:23:17 +00:00
|
|
|
class RedisEntryConsumer extends AbstractConsumer implements Job
|
2016-09-03 15:36:57 +00:00
|
|
|
{
|
|
|
|
/**
|
2016-09-09 19:02:03 +00:00
|
|
|
* Handle one message by one message.
|
|
|
|
*
|
|
|
|
* @param string $job Content of the message (directly from Redis)
|
|
|
|
*
|
|
|
|
* @return bool
|
2016-09-03 15:36:57 +00:00
|
|
|
*/
|
2016-09-09 19:02:03 +00:00
|
|
|
public function manage($job)
|
2016-09-03 15:36:57 +00:00
|
|
|
{
|
2016-09-11 18:23:17 +00:00
|
|
|
return $this->handleMessage($job);
|
2016-09-09 19:02:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Should tell if the given job will kill the worker.
|
|
|
|
* We don't want to stop it :).
|
2017-11-18 15:28:54 +00:00
|
|
|
*
|
|
|
|
* @param string $job Content of the message (directly from Redis)
|
|
|
|
*
|
|
|
|
* @return false
|
2016-09-09 19:02:03 +00:00
|
|
|
*/
|
|
|
|
public function isStopJob($job)
|
|
|
|
{
|
|
|
|
return false;
|
2016-09-03 15:36:57 +00:00
|
|
|
}
|
2017-11-18 15:28:54 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This abstract method is only used when we use one queue for multiple job type.
|
|
|
|
* We don't do that, so we'll always return true.
|
|
|
|
*
|
|
|
|
* @param string $job Content of the message (directly from Redis)
|
|
|
|
*
|
|
|
|
* @return true
|
|
|
|
*/
|
|
|
|
public function isMyJob($job)
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
2016-09-03 15:36:57 +00:00
|
|
|
}
|