function Promise.prototype._consumerCancelled(A,Q)if A._status~=Promise.Status.Started then return end A._consumers[Q]=nil if next(A._consumers)==nil then A:cancel()end end
--[[
	Used to decrease the number of consumers by 1, and if there are no more,
	cancel this promise.
]]
function Promise.prototype:_consumerCancelled(consumer)
	if self._status ~= Promise.Status.Started then
		return
	end

	self._consumers[consumer] = nil

	if next(self._consumers) == nil then
		self:cancel()
	end
end
