Commit | Line | Data |
cb2c6d47 |
1 | package # Hide from PAUSE |
2 | StompTestApp::Controller::TestController; |
0a663589 |
3 | use Moose; |
cb2c6d47 |
4 | use namespace::autoclean; |
0a663589 |
5 | |
6 | BEGIN { extends 'Catalyst::Controller::MessageDriven' }; |
7 | |
8 | sub testaction : Local { |
bf8937b7 |
9 | my ($self, $c, $request) = @_; |
0a663589 |
10 | |
11 | # Reply with a minimal response message |
12 | my $response = { type => 'testaction_response' }; |
13 | $c->stash->{response} = $response; |
14 | } |
15 | |
bf8937b7 |
16 | sub badaction : Local { |
17 | my ($self, $c, $request) = @_; |
18 | die "oh noes"; |
19 | } |
20 | |
40e96678 |
21 | sub ping : Local { |
22 | my ($self, $c, $request) = @_; |
23 | if ($request->{type} eq 'ping') { |
24 | $c->stash->{response} = { status => 'PONG' }; |
25 | return; |
26 | } |
27 | die "not a ping request?"; |
28 | } |
29 | |
0a663589 |
30 | 1; |