| 1 | # vim: ft=perl | ||
| 2 | |||
| 3 | 89 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 89 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | 89 | ▶ | use Ubic::Service::Common; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | 89 | ▶ | use Storable; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | |||
| 9 | my $file = 'tfiles/fake-http-service.status'; | ||
| 10 | return Ubic::Service::Common->new({ | ||
| 11 | start => sub { | ||
| 12 | store { status => 'running' } => $file; | ||
| 13 | }, | ||
| 14 | stop => sub { | ||
| 15 | store { status => 'not running' } => $file; | ||
| 16 | }, | ||
| 17 | status => sub { | ||
| 18 | return unless -e $file; | ||
| 19 | return retrieve($file)->{status}; | ||
| 20 | }, | ||
| 21 | port => 12347, | ||
| 22 | }); | ||