diff options
author | Jeremy Benoist <j0k3r@users.noreply.github.com> | 2016-09-19 07:15:40 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-19 07:15:40 +0200 |
commit | da18a4682f124b02278860d23ac1d59dee995277 (patch) | |
tree | eabbe9da7203eea41e0cb0ec3c26b9b6599cf58f /src/Wallabag/ImportBundle/Consumer/RedisEntryConsumer.php | |
parent | 0ed8ce55b5caf2c88e8330afa83abef6c4aac9a4 (diff) | |
parent | 59b97fae996d8307b9d957d210d46200f6d206bf (diff) | |
download | wallabag-da18a4682f124b02278860d23ac1d59dee995277.tar.gz wallabag-da18a4682f124b02278860d23ac1d59dee995277.tar.zst wallabag-da18a4682f124b02278860d23ac1d59dee995277.zip |
Merge pull request #1941 from wallabag/v2-asynchronous-jobs
Use asynchronous jobs for imports
Diffstat (limited to 'src/Wallabag/ImportBundle/Consumer/RedisEntryConsumer.php')
-rw-r--r-- | src/Wallabag/ImportBundle/Consumer/RedisEntryConsumer.php | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/Wallabag/ImportBundle/Consumer/RedisEntryConsumer.php b/src/Wallabag/ImportBundle/Consumer/RedisEntryConsumer.php new file mode 100644 index 00000000..450b71ff --- /dev/null +++ b/src/Wallabag/ImportBundle/Consumer/RedisEntryConsumer.php | |||
@@ -0,0 +1,29 @@ | |||
1 | <?php | ||
2 | |||
3 | namespace Wallabag\ImportBundle\Consumer; | ||
4 | |||
5 | use Simpleue\Job\Job; | ||
6 | |||
7 | class RedisEntryConsumer extends AbstractConsumer implements Job | ||
8 | { | ||
9 | /** | ||
10 | * Handle one message by one message. | ||
11 | * | ||
12 | * @param string $job Content of the message (directly from Redis) | ||
13 | * | ||
14 | * @return bool | ||
15 | */ | ||
16 | public function manage($job) | ||
17 | { | ||
18 | return $this->handleMessage($job); | ||
19 | } | ||
20 | |||
21 | /** | ||
22 | * Should tell if the given job will kill the worker. | ||
23 | * We don't want to stop it :). | ||
24 | */ | ||
25 | public function isStopJob($job) | ||
26 | { | ||
27 | return false; | ||
28 | } | ||
29 | } | ||