What is the best way for a server to process messages in Perl?
I'm trying
while ( 1 ) {
# Get Queue Messages
# Do Work
sleep( 10 );
}
My mysql schema is of the sort
create table message (
id int auto_increment primary key,
processed int,
message varchar(100)
)
and in my "#Get Queue Messages", I do a request like
select * from message where processed = 0
and then flip the flag when it's done.
Is there a better way to do this?