Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 10 of 17 for drainTo (0.04 seconds)

  1. guava/src/com/google/common/collect/Queues.java

         */
        long deadline = System.nanoTime() + unit.toNanos(timeout);
        int added = 0;
        while (added < numElements) {
          // we could rely solely on #poll, but #drainTo might be more efficient when there are multiple
          // elements already available (e.g. LinkedBlockingQueue#drainTo locks only once)
          added += q.drainTo(buffer, numElements - added);
    Created: Fri Dec 26 12:43:10 GMT 2025
    - Last Modified: Tue Nov 04 17:24:58 GMT 2025
    - 18K bytes
    - Click Count (0)
  2. android/guava/src/com/google/common/collect/Queues.java

         */
        long deadline = System.nanoTime() + unit.toNanos(timeout);
        int added = 0;
        while (added < numElements) {
          // we could rely solely on #poll, but #drainTo might be more efficient when there are multiple
          // elements already available (e.g. LinkedBlockingQueue#drainTo locks only once)
          added += q.drainTo(buffer, numElements - added);
    Created: Fri Dec 26 12:43:10 GMT 2025
    - Last Modified: Tue Nov 04 17:24:58 GMT 2025
    - 18.2K bytes
    - Click Count (0)
  3. okhttp-testing-support/src/main/kotlin/okhttp3/internal/concurrent/TaskFaker.kt

        ) = error("unsupported")
    
        override fun take() = error("unsupported")
    
        override fun remainingCapacity() = error("unsupported")
    
        override fun drainTo(sink: MutableCollection<in T>) = error("unsupported")
    
        override fun drainTo(
          sink: MutableCollection<in T>,
          maxElements: Int,
        ) = error("unsupported")
      }
    
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Wed May 28 23:28:25 GMT 2025
    - 11.9K bytes
    - Click Count (0)
  4. android/guava-tests/benchmark/com/google/common/util/concurrent/MonitorBasedPriorityBlockingQueue.java

     * is not guaranteed to traverse the elements of the MonitorBasedPriorityBlockingQueue in
     * any particular order. If you need ordered traversal, consider using {@code
     * Arrays.sort(pq.toArray())}. Also, method {@code drainTo} can be used to remove some or
     * all elements in priority order and place them in another collection.
     *
     * <p>Operations on this class make no guarantees about the ordering of elements with equal
    Created: Fri Dec 26 12:43:10 GMT 2025
    - Last Modified: Tue May 13 18:46:00 GMT 2025
    - 18.9K bytes
    - Click Count (0)
  5. guava-tests/benchmark/com/google/common/util/concurrent/MonitorBasedArrayBlockingQueue.java

       * @throws ClassCastException {@inheritDoc}
       * @throws NullPointerException {@inheritDoc}
       * @throws IllegalArgumentException {@inheritDoc}
       */
      @CanIgnoreReturnValue
      @Override
      public int drainTo(Collection<? super E> c) {
        if (c == null) throw new NullPointerException();
        if (c == this) throw new IllegalArgumentException();
        E[] items = this.items;
        Monitor monitor = this.monitor;
    Created: Fri Dec 26 12:43:10 GMT 2025
    - Last Modified: Tue May 13 18:46:00 GMT 2025
    - 22.4K bytes
    - Click Count (0)
  6. guava-tests/test/com/google/common/collect/QueuesTest.java

          assertEquals(0, Queues.drain(q, ImmutableList.of(), 1, 10, MILLISECONDS));
    
          Producer producer = new Producer(q, 1);
          // producing one, will ask for two
          Future<?> producerThread = threadPool.submit(producer);
          producer.beganProducing.await();
    
          // make sure we time out
          Stopwatch timer = Stopwatch.createStarted();
    
    Created: Fri Dec 26 12:43:10 GMT 2025
    - Last Modified: Tue Nov 04 17:24:58 GMT 2025
    - 12.6K bytes
    - Click Count (0)
  7. internal/logger/target/http/http.go

    			select {
    			case currentGlobalBuffer <- v:
    			default:
    			}
    		}
    
    		if mainWorker {
    		drain:
    			for {
    				select {
    				case v, ok := <-h.logCh:
    					if !ok {
    						break drain
    					}
    
    					currentGlobalBuffer <- v
    				default:
    					break drain
    				}
    			}
    		}
    	}()
    
    	lastBatchProcess := time.Now()
    
    	buf := bytebufferpool.Get()
    Created: Sun Dec 28 19:28:13 GMT 2025
    - Last Modified: Fri Aug 29 02:39:48 GMT 2025
    - 15.6K bytes
    - Click Count (0)
  8. android/guava/src/com/google/common/util/concurrent/SequentialExecutor.java

         * will still be present. If the composed Executor is an ExecutorService, it can respond to
         * shutdown() by returning tasks queued on that Thread after {@link #worker} drains the queue.
         */
        @SuppressWarnings("CatchingUnchecked") // sneaky checked exception
        private void workOnQueue() {
          boolean interruptedDuringTask = false;
          boolean hasSetRunning = false;
    Created: Fri Dec 26 12:43:10 GMT 2025
    - Last Modified: Sun Dec 22 03:38:46 GMT 2024
    - 10.6K bytes
    - Click Count (0)
  9. guava/src/com/google/common/util/concurrent/SequentialExecutor.java

         * will still be present. If the composed Executor is an ExecutorService, it can respond to
         * shutdown() by returning tasks queued on that Thread after {@link #worker} drains the queue.
         */
        @SuppressWarnings("CatchingUnchecked") // sneaky checked exception
        private void workOnQueue() {
          boolean interruptedDuringTask = false;
          boolean hasSetRunning = false;
    Created: Fri Dec 26 12:43:10 GMT 2025
    - Last Modified: Sun Dec 22 03:38:46 GMT 2024
    - 10.6K bytes
    - Click Count (0)
  10. src/bytes/buffer.go

    		c = 2 * cap(b)
    	}
    	b2 := append([]byte(nil), make([]byte, c)...)
    	i := copy(b2, b)
    	return b2[:i]
    }
    
    // WriteTo writes data to w until the buffer is drained or an error occurs.
    // The return value n is the number of bytes written; it always fits into an
    // int, but it is int64 to match the [io.WriterTo] interface. Any error
    // encountered during the write is also returned.
    Created: Tue Dec 30 11:13:12 GMT 2025
    - Last Modified: Fri Nov 14 19:01:17 GMT 2025
    - 16.5K bytes
    - Click Count (0)
Back to Top