'Discard all waiting tasks.
This will ignore all tasks waiting for execution, and they will
be deleted from the messaging server.
Arguments:
connection (kombu.Connection): Optional specific connection
instance to use.  If not provided a connection will
be acquired from the connection pool.
Returns:
int: the number of tasks discarded.'

def purge(self, connection=None):

    with self.app.connection_or_acquire(connection) as conn:
        return self.app.amqp.TaskConsumer(conn).purge()
