« blib/lib/auto/share/dist/Beekeeper/chat/lib/MyApp/Service/Auth.pm
↑ Summary
blib/lib/auto/share/dist/Beekeeper/flood/lib/MyApp/Service/Flood/Worker.pm »
| 1 | package MyApp::Service::Flood; | ||
| 2 | |||
| 3 | use strict; | ||
| 4 | use warnings; | ||
| 5 | |||
| 6 | use Beekeeper::Client; | ||
| 7 | |||
| 8 | |||
| 9 | sub notify { | ||
| 10 | my ($self, $params) = @_; | ||
| 11 | |||
| 12 | my $client = Beekeeper::Client->instance; | ||
| 13 | |||
| 14 | $client->send_notification( | ||
| 15 | method => 'myapp.flood.msg', | ||
| 16 | params => $params, | ||
| 17 | ); | ||
| 18 | } | ||
| 19 | |||
| 20 | sub echo { | ||
| 21 | my ($self, $params) = @_; | ||
| 22 | |||
| 23 | my $client = Beekeeper::Client->instance; | ||
| 24 | |||
| 25 | my $resp = $client->call_remote( | ||
| 26 | method => 'myapp.flood.echo', | ||
| 27 | params => $params, | ||
| 28 | ); | ||
| 29 | |||
| 30 | return $resp->result; | ||
| 31 | } | ||
| 32 | |||
| 33 | sub fire_echo { | ||
| 34 | my ($self, $params) = @_; | ||
| 35 | |||
| 36 | my $client = Beekeeper::Client->instance; | ||
| 37 | |||
| 38 | $client->fire_remote( | ||
| 39 | method => 'myapp.flood.echo', | ||
| 40 | params => $params, | ||
| 41 | ); | ||
| 42 | } | ||
| 43 | |||
| 44 | sub async_echo { | ||
| 45 | my ($self, $params, $on_success) = @_; | ||
| 46 | |||
| 47 | my $client = Beekeeper::Client->instance; | ||
| 48 | |||
| 49 | $client->call_remote_async( | ||
| 50 | method => 'myapp.flood.echo', | ||
| 51 | params => $params, | ||
| 52 | on_success => $on_success, | ||
| 53 | ); | ||
| 54 | } | ||
| 55 | |||
| 56 | 1; |