# Make a connection to the database; # While not killed by a signal # Check to see if there are any new records, and do # something with the new records; # Sleep for some period; # Close the connection to the database.