| 1 | package Queue::Leaky::Driver::Q4M; | ||
| 2 | |||
| 3 | use Moose; | ||
| 4 | use Queue::Q4M; | ||
| 5 | |||
| 6 | has 'connect_info' => ( | ||
| 7 | is => 'rw', | ||
| 8 | isa => 'ArrayRef', | ||
| 9 | required => 1 | ||
| 10 | ); | ||
| 11 | |||
| 12 | has 'q4m' => ( | ||
| 13 | is => 'rw', | ||
| 14 | isa => 'Queue::Q4M', | ||
| 15 | handles => { | ||
| 16 | next => 'next', | ||
| 17 | insert => 'insert', | ||
| 18 | clear => 'clear', | ||
| 19 | fetch => 'fetch_hashref', | ||
| 20 | }, | ||
| 21 | ); | ||
| 22 | |||
| 23 | with 'Queue::Leaky::Driver'; | ||
| 24 | |||
| 25 | __PACKAGE__->meta->make_immutable; | ||
| 26 | |||
| 27 | no Moose; | ||
| 28 | |||
| 29 | sub BUILD { | ||
| 30 | my $self = shift; | ||
| 31 | $self->q4m( | ||
| 32 | Queue::Q4M->connect( connect_info => $self->connect_info ) | ||
| 33 | ); | ||
| 34 | $self; | ||
| 35 | } | ||
| 36 | |||
| 37 | 1; | ||
| 38 | |||
| 39 | __END__ |