Commit b34bbb0e authored by Craig Andrews's avatar Craig Andrews

Store serialized representations of queue items in the queue

parent 611924e8
......@@ -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);
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment