Blocks until the transfer is complete or
the transfer fails.
186518
public synchronized void waitForEnd()
	throws ServerException,
	       ClientException,
	       IOException {
        try {
            while(!isDone() && !hasError()) {
                wait();
            }
        } catch(InterruptedException e) {
            // break
        }
	    checkError();
    }
880209
public void complete(VirtualConnection vc, TCPReadRequestContext rsc) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "complete() called: vc=" + vc);
        }

        HttpOutboundServiceContextImpl osc = (HttpOutboundServiceContextImpl) vc.getStateMap().get(CallbackIDs.CALLBACK_HTTPOSC);
        osc.markReadCancelFailure();

        int state;
        // query/set the states in one block to avoid timing windows
        synchronized (osc.stateSyncObject) {
            state = osc.getReadState();
            osc.setCallbackState(HttpOutboundServiceContextImpl.CALLBACK_STATE_COMPLETE, null);
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "Read-ahead state: " + state);
        }

        switch (state) {
            case (HttpOutboundServiceContextImpl.READ_STATE_IDLE):
                // connection is still in app channel's pool, error condition
                IOException ioe = new IOException("Unexpected read complete");
                osc.getAppReadCallback().error(vc, ioe);
                break;
            case (HttpOutboundServiceContextImpl.READ_STATE_TIME_RESET):
                // init() has been called and the read-ahead should have been
                // canceled, so this is an error
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                    Tr.debug(tc, "Error: Read-ahead completed after init() call.");
                }
                osc.setCallbackState(HttpOutboundServiceContextImpl.CALLBACK_STATE_ERROR, new IOException("Invalid read-ahead data"));
                break;
            case (HttpOutboundServiceContextImpl.READ_STATE_SYNC):
                // d264854: no longer possible
                // sync read for the response has already started
                osc.wakeupReadAhead();
                break;
            case (HttpOutboundServiceContextImpl.READ_STATE_ASYNC):
                // d264854: no longer possible
                // async read for the response has already started
                HttpOSCReadCallback.getRef().complete(vc, rsc);
                break;
            default:
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                    Tr.debug(tc, "Unexpected read-ahead state: " + state);
                }
                break;
        }
    }
737583
def wait(self, *, timeout=None):
        
        for _ in self.get_results(block=True, timeout=timeout):  # pragma: no cover
            pass
577193
public void handleBlockCompleteRequest(boolean isCanceled) {
    final String methodName = isCanceled ? "AbortBlock" : "CommitBlock";
    RpcUtils.streamingRPCAndLog(LOG, new RpcUtils.StreamingRpcCallable<CreateLocalBlockResponse>() {
      @Override
      public CreateLocalBlockResponse call() throws Exception {
        if (mRequest == null) {
          return null;
        }
        Context newContext = Context.current().fork();
        Context previousContext = newContext.attach();
        try {
          if (isCanceled) {
            mBlockWorker.abortBlock(mSessionId, mRequest.getBlockId());
          } else {
            mBlockWorker.commitBlock(mSessionId, mRequest.getBlockId());
          }
        } finally {
          newContext.detach(previousContext);
        }
        mSessionId = INVALID_SESSION_ID;
        return null;
      }

      @Override
      public void exceptionCaught(Throwable throwable) {
        mResponseObserver.onError(GrpcExceptionUtils.fromThrowable(throwable));
        mSessionId = INVALID_SESSION_ID;
      }
    }, methodName, false, !isCanceled, mResponseObserver, "Session=%d, Request=%s", mSessionId,
        mRequest);
  }
352336
def wait_send(self, timeout = None):
		""""""
		self._send_queue_cleared.clear()
		self._send_queue_cleared.wait(timeout = timeout)
672214
public static void afterCompletion(TransactionImpl tran, int status, int syncLevel) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            Tr.entry(tc, "afterCompletion", new Object[] { tran, status, syncLevel });

        if (syncLevel >= 0) {
            final ArrayList syncs = _syncLevels.get(syncLevel);

            if (syncs != null) {
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                    Tr.debug(tc, "syncs.length=" + syncs.size());

                final int localID = (int) tran.getLocalTID();
                final byte[] globalID = tran.getTID();
                // d281425 - status maybe committed, unknown or rolledback
                final boolean committed = !(status == Status.STATUS_ROLLEDBACK); // @281425C
                final int numSyncs = syncs.size();

                for (int s = 0; s < numSyncs; s++) {
                    try {
                        ((SynchronizationCallback) syncs.get(s)).afterCompletion(localID, globalID, committed);
                    } catch (Throwable t) {
                        // No FFDC needed
                        Tr.error(tc, "WTRN0074_SYNCHRONIZATION_EXCEPTION", new Object[] { "afterCompletion", syncs.get(s), t });
                        // absorb and allow other afterCompletions to run.
                    }
                }
            } else if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                Tr.debug(tc, "syncs is null");
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            Tr.exit(tc, "afterCompletion");
    }
252627
public EventResultDisruptor waitForBlocking() {
		SequenceBarrier barrier = ringBuffer.newBarrier();
		try {
			long a = barrier.waitFor(waitAtSequence);
			if (ringBuffer != null)
				return ringBuffer.get(a);
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			barrier.alert();
		}
		return null;
	}
498883
function(e){
          var status = $.status();
          if(status=='success'||status=='error') {
            $.callback(status, $.message());
            $.resumableObj.uploadNextChunk();
          } else {
            $.callback('retry', $.message());
            $.abort();
            $.retries++;
            var retryInterval = $.getOpt('chunkRetryInterval');
            if(retryInterval !== undefined) {
              $.pendingRetry = true;
              setTimeout($.send, retryInterval);
            } else {
              $.send();
            }
          }
        }
1278377
def set_exception(self, exception):
        """"""
        if not self.is_done():
            raise TransferNotDoneError(
                'set_exception can only be called once the transfer is '
                'complete.')
        self._coordinator.set_exception(exception, override=True)
1044329
private S waitForCompletionAndThrowIfUploadFailed() throws IOException {
    try {
      return uploadOperation.get();
    } catch (InterruptedException e) {
      // If we were interrupted, we need to cancel the upload operation.
      uploadOperation.cancel(true);
      IOException exception = new ClosedByInterruptException();
      exception.addSuppressed(e);
      throw exception;
    } catch (ExecutionException e) {
      if (e.getCause() instanceof Error) {
        throw (Error) e.getCause();
      }
      throw new IOException("Upload failed", e.getCause());
    }
  }
1221041
def _wait_and_except_if_failed(self, event, timeout=None):
        
        event.wait(timeout or self.__sync_timeout)
        self._except_if_failed(event)
714383
private void waitIndexingNotSuspended() {
        boolean suspendedNotified = false;
        synchronized (suspendLock) {
            while (suspend > 0) {
                if (!suspendedNotified) {
                    suspendedNotified = true;
                }
                try {
                    suspendLock.wait();
                } catch (InterruptedException ex) {
                }
            }
        }
    }
216883
def on_failure(&block)
      on do |_, _, reason|
        block.call(reason) if reason
      end
    end
863770
def wait(self):
        
        if self._pool is None:
            return
        self._pool.close()
        self._pool.join()
138144
public void waitForExit() {
        if (shutdownHook != null) {
            synchronized (shutdownHookMonitor) {
                if (shutdownHook != null) {
                    synchronized (frameworkProcessMonitor) {
                        try {
                            frameworkProcess.waitFor();
                            shutdown();
                        // CHECKSTYLE:SKIP
                        } catch (Throwable e) {
                            shutdown();
                        }
                    }
                }
            }
        }
    }
1095634
private void transferToUfsBlock(BlockWriteRequestContext context, long pos) throws Exception {
    OutputStream ufsOutputStream = context.getOutputStream();

    long sessionId = context.getRequest().getSessionId();
    long blockId = context.getRequest().getId();
    TempBlockMeta block = mWorker.getBlockStore().getTempBlockMeta(sessionId, blockId);
    if (block == null) {
      throw new NotFoundException("block " + blockId + " not found");
    }
    Preconditions.checkState(Files.copy(Paths.get(block.getPath()), ufsOutputStream) == pos);
  }
279795
def wait(self):
        
        if self.error:
            raise self.error
        if not self.running:
            raise ValueError("Unable to send until client has been started.")
        try:
            self._handler.wait()
        except (errors.TokenExpired, errors.AuthenticationException):
            log.info("Sender disconnected due to token error. Attempting reconnect.")
            self.reconnect()
        except (errors.LinkDetach, errors.ConnectionClose) as shutdown:
            if shutdown.action.retry and self.auto_reconnect:
                log.info("Sender detached. Attempting reconnect.")
                self.reconnect()
            else:
                log.info("Sender detached. Shutting down.")
                error = EventHubError(str(shutdown), shutdown)
                self.close(exception=error)
                raise error
        except errors.MessageHandlerError as shutdown:
            if self.auto_reconnect:
                log.info("Sender detached. Attempting reconnect.")
                self.reconnect()
            else:
                log.info("Sender detached. Shutting down.")
                error = EventHubError(str(shutdown), shutdown)
                self.close(exception=error)
                raise error
        except Exception as e:
            log.info("Unexpected error occurred (%r).", e)
            raise EventHubError("Send failed: {}".format(e))