nl_tokens: cancellation of the main task . We ll simply resume the Generator with a Cancel
pl_tokens: function cancelMain ( ) { if ( mainTask . isRunning && ! mainTask . isCancelled ) { mainTask . isCancelled = true <mask> ( TASK_CANCEL ) } }