def dequeue(self, destination):
session = meta.Session()<EOL>try:<EOL><INDENT>selstmt = select(<EOL>[model.frames_table.c.message_id, model.frames_table.c.frame])<EOL>selstmt = selstmt.where(<EOL>model.frames_table.c.destination == destination)<EOL>selstmt = selstmt.order_by(<EOL>model.frames_table.c.queued, model.frames_table.c.sequence)<EOL>result = session.execute(selstmt)<EOL>first = result.fetchone()<EOL>if not first:<EOL><INDENT>return None<EOL><DEDENT>delstmt = model.frames_table.delete().where(model.frames_table.c.message_id ==<EOL>first[model.frames_table.c.message_id])<EOL>session.execute(delstmt)<EOL>frame = first[model.frames_table.c.frame]<EOL><DEDENT>except:<EOL><INDENT>session.rollback()<EOL>raise<EOL><DEDENT>else:<EOL><INDENT>session.commit()<EOL>return frame<EOL><DEDENT>
Removes and returns an item from the queue (or C{None} if no items in queue).

@param destination: The queue name (destinationination).
@type destination: C{str}

@return: The first frame in the specified queue, or C{None} if there are none.
@rtype: C{stompclient.frame.Frame}