Try to cancel jobs with associated ids.
		
		Return the actual number of jobs cancelled.

def cancel(self, *ids):
		"""Try to cancel jobs with associated ids.
		
		Return the actual number of jobs cancelled.
		"""
		ncancelled = 0
		with self.lock:
			for id in ids:
				try:
					if self._status[id] == 'SUBMITTED':
						self._status[id] = 'CANCELLED'
						ncancelled += 1
				except IndexError:
					pass
		return ncancelled