Hi Sergey,
Show quoted text> For module completeness I suggest create_queue(), delete_queue() and
> is_queue_exists() functions,
> so:
> * no need to manually insert/delete queue into DB
> * I can write something like: Queue::DBI::create_queue('my_que')
> unless Queue::DBI::is_queue_exists('my_que');
> * I can additionaly create/delete temporary queues
Being able to manage queues is a great extension for this module,
however since you need $dbh for each operation I'm concerned that the
API would have to be, for example:
Queue::DBI::create_queue(
'my_queue',
dbh => $dbh,
);
Passing $dbh around each time doesn't seem as easy as it could be. What
would you think of the following tweak to it:
use Queue::DBI::Admin;
my $queues_admin = Queue::DBI::Admin->new(
dbh => $dbh,
);
$queues_admin->create_tables(); # Formerly Queue::DBI::create_tables()
$queues_admin->create_queue( $queue_name )
if !$queues_admin->has_queue( $queue_name );
$queues_admin->delete_queue( $queue_name );
Please let me know what you think, and thank you again for your suggestions!
Guillaume