Tomas Doran > Catalyst-Engine-Stomp-0.05 > Catalyst::Controller::MessageDriven

Download:
Catalyst-Engine-Stomp-0.05.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  1
View/Report Bugs
Source   Latest Release: Catalyst-Engine-Stomp-0.17

NAME ^

Catalyst::Controller::MessageDriven

SYNOPSIS ^

  package MyApp::Controller::Queue;
  use Moose;
  BEGIN { extends 'Catalyst::Controller::MessageDriven' }

  sub some_action : Local {
      my ($self, $c, $message) = @_;

      # Handle message

      # Reply with a minimal response message
      my $response = { type => 'testaction_response' };
      $c->stash->{response} = $response;
  }

DESCRIPTION ^

A Catalyst controller base class for use with Catalyst::Engine::Stomp, which handles YAML-serialized messages. A top-level "type" key in the YAML determines the action dispatched to.

METHODS ^

begin

Deserializes the request into $c->stash->{request}

default

Dispatches to method named by the key $c->stash->{request}->{type}

end

Serializes the response from $c->stash->{response}

syntax highlighting: