Cancel a specific asynchronous call.

@param id The id of the call as returned by the callAsync method.
189996
public void cancel(long id) {

		// Lookup the background call for the given id.
		Caller cancel = backgroundCalls.get(id);
		if(cancel == null) {
			return;
		}

		// Cancel the thread
		cancel.cancel();

		try {
			// Wait for the thread
			cancel.join();
		} catch (InterruptedException ex) {
			// Ignore this
		}

	}
940467
def _pop_async_request(self, msg_id, msg_name):
        
        assert get_thread_ident() == self.ioloop_thread_id
        if msg_id is None:
            msg_id = self._msg_id_for_name(msg_name)
        if msg_id in self._async_queue:
            callback_tuple = self._async_queue[msg_id]
            del self._async_queue[msg_id]
            self._async_id_stack[callback_tuple[0].name].remove(msg_id)
            return callback_tuple
        else:
            return None, None, None, None, None
963723
@Override
    public void delete(final I id) {
        if (entity != null) {
            inTransaction(
                    new Callable<Void>() {
                        @Override
                        public Void call() throws Exception {
                            final T entity = findOne(id);
                            T attached = getAttached(entity);
                            if (attached != null) {
                                entityManager.remove(attached);
                            }
                            return null;
                        }
                    }
            );
        }
    }
642636
public synchronized boolean remove(int id)
   {
		if (tc.isEntryEnabled()) SibTr.entry(this, tc, "remove", ""+id);
      
      final boolean result = contains(id);
      if (result)
      {
         mutableKey.setValue(id);
         idToConvTable.remove(mutableKey);
      }
      if (tc.isEntryEnabled()) SibTr.exit(this, tc, "remove", ""+result);
      return result;
   }
1008155
@Override
    public void delete(final String id) {
        if (!StringUtils.isEmpty(id)) {
            doDelete(id);
            notifyDeleted(id);
        }
    }
802125
public void cancel(com.google.gwt.dom.client.Element e) {
    setElement(e);
    // This has to be the order of calls
    cancel(e.<com.google.gwt.user.client.Element> cast());
  }
851240
public T remove(final int id) {
        final T n = get(id);
        if (n != null) {
            notificationArray.remove(id);
            return n;
        }

        return null;
    }
253687
@Override
  public synchronized boolean cancel(boolean mayInterruptIfRunning) {
    if (isDone())
      return false;

    boolean cancelResult = super.cancel(mayInterruptIfRunning);
    if (delegate != null)
      cancelResult = delegate.cancel(mayInterruptIfRunning);
    Throwable failure = new CancellationException();
    complete(null, failure);
    executor.handleComplete(ExecutionResult.failure(failure), execution);
    return cancelResult;
  }
872045
public void deleteById(String id) {
    if (idToVersion.containsKey(id)) {
      String version = idToVersion.remove(id);
      expirationVersion.remove(version);
      versionToItem.remove(version);
      if (collectionCachePath != null
          && !collectionCachePath.resolve(version).toFile().delete()) {
        log.debug("couldn't delete " + version);
      }
    }
  }
842112
private void removeServiceListeners(String id) {
        final ServiceListener[] listeners = serviceListeners.remove(id);
        if (listeners != null)
            for (ServiceListener listener : listeners)
                if (listener != null) {
                    lock.readLock().lock();
                    try {
                        if (bundleContext != null)
                            bundleContext.removeServiceListener(listener);
                    } finally {
                        lock.readLock().unlock();
                    }
                }
    }
128517
function invoke(id) {
  this.isPending[id] = true;
  this.callbacks[id](this.pendingPayload);
  this.isHandled[id] = true;
}
1225044
public void cancel() {
        if(actionInBackground != null) {
            if(executorService != null) {
               asyncFutureTask.cancel(true);
            } else {
                asyncThread.interrupt();
            }
        }
    }
434003
def _cancel(self, id_cancel) -> None:
        
        if _logger is not None:
            self._log(DEBUG, "cancel", id=id_cancel)
        for event in self._events:
            if event.identifier == id_cancel:
                event.cancel()
                break
625289
boolean cancel(int downloadId) {
    synchronized (currentRequests) {
      for (DownloadRequest request : currentRequests) {
        if (request.downloadId() == downloadId) {
          request.cancel();
          return true;
        }
      }
    }

    return false;
  }
261533
public static synchronized void stopUpload(final String uploadId) {
        UploadTask removedTask = uploadTasksMap.get(uploadId);
        if (removedTask != null) {
            removedTask.cancel();
        }
    }
322880
@POST
    @Path("close")    
    public void close(String id) {
    	Statement statement = StatementHolder.get().get(id);
    	try {
			statement.close();
			StatementHolder.get().remove(id);
		} catch (SQLException e) {
			// TODO
			throw new RuntimeException(e);
		}		
    }
769531
public void set_async_reply_cb(final int id, final CallBack cb) {
        final AsyncCallObject aco = async_request_table.get(id);
        if (aco != null) {
            aco.cb = cb;
        }
    }