How we can cancel the whole queue

Hi community ,
I am using the cyclic queue to achieve the functionality, but if I need to cancel or stop the execution in between, how can I quit the whole job?
I tried with cancel() but it is not working. Can anyone please help me with this?