diff options
author | franck cuny <franck@lumberjaph.net> | 2010-05-15 13:09:13 +0200 |
---|---|---|
committer | franck cuny <franck@lumberjaph.net> | 2010-05-15 13:09:13 +0200 |
commit | 87361f653b2b9d7cb1982c9b2f9ab02aeaaa3935 (patch) | |
tree | c64021d5e22b281b9e130035fbb5625257c21ae4 /lib/presque/ControlHandler.pm | |
parent | serialize to json the response (diff) | |
download | presque-87361f653b2b9d7cb1982c9b2f9ab02aeaaa3935.tar.gz |
use 'entity' to serialize response content
Diffstat (limited to 'lib/presque/ControlHandler.pm')
-rw-r--r-- | lib/presque/ControlHandler.pm | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/lib/presque/ControlHandler.pm b/lib/presque/ControlHandler.pm index e638798..7ef56e5 100644 --- a/lib/presque/ControlHandler.pm +++ b/lib/presque/ControlHandler.pm @@ -20,12 +20,10 @@ sub get { $self->_queue_stat($queue_name), sub { my $status = shift; - $self->finish( - JSON::encode_json( - { queue => $queue_name, - status => $status - } - ) + $self->entity( + { queue => $queue_name, + status => $status + } ); } ); @@ -56,12 +54,10 @@ sub _set_status { my $key = $self->_queue_stat($queue_name); $self->application->redis->set($key, $status); - $self->finish( - JSON::encode_json( - { queue => $queue_name, - response => 'updated', - } - ) + $self->entity( + { queue => $queue_name, + response => 'updated', + } ); } |