class Async::WorkerPool::Promise

def cancel

Cancel the work and raise an exception in the background thread.
def cancel
	return unless @work
	
	@guard.synchronize do
		@work = nil
		@state = :cancelled
		@thread&.raise(Interrupt)
	end
end