diff options
author | Craig Andrews <candrews@integralblue.com> | 2010-01-22 17:55:26 -0500 |
---|---|---|
committer | Craig Andrews <candrews@integralblue.com> | 2010-01-22 17:55:26 -0500 |
commit | b34bbb0e8045008a0048829672af905385241735 (patch) | |
tree | 82942d39d95aaae024e29593ce95b012f99f5185 /lib/queuemanager.php | |
parent | 611924e814320c768771af21a923e615118c1feb (diff) |
Store serialized representations of queue items in the queue
Diffstat (limited to 'lib/queuemanager.php')
-rw-r--r-- | lib/queuemanager.php | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/lib/queuemanager.php b/lib/queuemanager.php index 4eb39bfa8..8921b02cc 100644 --- a/lib/queuemanager.php +++ b/lib/queuemanager.php @@ -139,20 +139,13 @@ abstract class QueueManager extends IoManager /** * Encode an object for queued storage. - * Next gen may use serialization. * * @param mixed $object * @return string */ protected function encode($object) { - if ($object instanceof Notice) { - return $object->id; - } else if (is_string($object)) { - return $object; - } else { - throw new ServerException("Can't queue this type", 500); - } + return serialize($object); } /** @@ -164,11 +157,7 @@ abstract class QueueManager extends IoManager */ protected function decode($frame) { - if (is_numeric($frame)) { - return Notice::staticGet(intval($frame)); - } else { - return $frame; - } + return unserialize($frame); } /** |