Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 10 of 19 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. 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)
  4. api/maven-api-cli/src/main/java/org/apache/maven/api/cli/Logger.java

                @Nullable Throwable error) {}
    
        /**
         * If this is an accumulating log, it will "drain" this instance. It returns the accumulated log entries, and
         * also "resets" this instance to empty (initial) state.
         */
        @Nonnull
        default List<Entry> drain() {
            return List.of();
        }
    Created: Sun Dec 28 03:35:09 GMT 2025
    - Last Modified: Thu Oct 16 06:12:36 GMT 2025
    - 5K bytes
    - Click Count (0)
  5. 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)
  6. guava/src/com/google/common/cache/LocalCache.java

         * list's ordering. It is drained as a batch operation when either the DRAIN_THRESHOLD is
         * crossed or a write occurs on the segment.
         */
        final Queue<ReferenceEntry<K, V>> recencyQueue;
    
        /**
         * A counter of the number of reads since the last write, used to drain queues on a small
         * fraction of read operations.
         */
    Created: Fri Dec 26 12:43:10 GMT 2025
    - Last Modified: Thu Sep 11 19:35:11 GMT 2025
    - 148.9K bytes
    - Click Count (0)
  7. internal/bpool/bpool_test.go

    	}
    
    	bp.Put(b)
    
    	// Check the size of the pool.
    	if uint64(len(bp.c)) != size {
    		t.Fatalf("bytepool size invalid: got %v want %v", len(bp.c), size)
    	}
    
    	// lets drain the buf channel first before we validate invalid buffers.
    	for range size {
    		bp.Get() // discard
    	}
    
    	// Try putting some invalid buffers into pool
    Created: Sun Dec 28 19:28:13 GMT 2025
    - Last Modified: Fri Aug 29 02:39:48 GMT 2025
    - 2.7K bytes
    - Click Count (0)
  8. 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)
  9. android/guava/src/com/google/common/collect/MapMakerInternalMap.java

       *
       * This implementation uses a per-segment queue to record a memento of the additions, removals,
       * and accesses that were performed on the map. The queue is drained on writes and when it exceeds
       * its capacity threshold.
       *
       * The Least Recently Used page replacement algorithm was chosen due to its simplicity, high hit
    Created: Fri Dec 26 12:43:10 GMT 2025
    - Last Modified: Mon Sep 22 18:35:44 GMT 2025
    - 89.9K bytes
    - Click Count (0)
  10. internal/grid/grid_test.go

    	<-serverSent
    
    	// Now do 100 other requests to ensure that the server doesn't block.
    	for range 100 {
    		_, err := remoteConn.Request(ctx, handlerTest2, []byte(testPayload))
    		errFatal(err)
    	}
    	// Drain responses
    	got := 0
    	for resp := range st.responses {
    		// t.Log("got response", resp)
    		errFatal(resp.Err)
    		if resp.Msg[0] != byte(got) {
    			t.Error("expected response", got, "got", resp.Msg[0])
    		}
    Created: Sun Dec 28 19:28:13 GMT 2025
    - Last Modified: Fri Aug 29 02:39:48 GMT 2025
    - 36.1K bytes
    - Click Count (0)
Back to Top