Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 21 for CountDownLatch (0.19 sec)

  1. okhttp/src/main/kotlin/okhttp3/internal/concurrent/TaskQueue.kt

          delayNanos,
        )
      }
    
      /** Returns a latch that reaches 0 when the queue is next idle. */
      fun idleLatch(): CountDownLatch {
        taskRunner.lock.withLock {
          // If the queue is already idle, that's easy.
          if (activeTask == null && futureTasks.isEmpty()) {
            return CountDownLatch(0)
          }
    
          // If there's an existing AwaitIdleTask, use it. This is necessary when the executor is
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 7.5K bytes
    - Viewed (0)
  2. okhttp/src/test/java/okhttp3/internal/http2/HttpOverHttp2Test.kt

        val responseDequeuedLatches =
          Arrays.asList(
            CountDownLatch(1),
            // No synchronization for the last request, which is not canceled:
            CountDownLatch(1),
            CountDownLatch(0),
          )
        val requestCanceledLatches =
          Arrays.asList(
            CountDownLatch(1),
            CountDownLatch(1),
            CountDownLatch(0),
          )
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Thu Apr 11 22:09:35 GMT 2024
    - 75.3K bytes
    - Viewed (0)
  3. okhttp/src/test/java/okhttp3/WholeOperationTimeoutTest.kt

    import assertk.assertions.isNotNull
    import assertk.assertions.isTrue
    import java.io.IOException
    import java.io.InterruptedIOException
    import java.net.HttpURLConnection
    import java.time.Duration
    import java.util.concurrent.CountDownLatch
    import java.util.concurrent.TimeUnit
    import java.util.concurrent.atomic.AtomicReference
    import kotlin.test.assertFailsWith
    import mockwebserver3.MockResponse
    import mockwebserver3.MockWebServer
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 10.5K bytes
    - Viewed (0)
  4. mockwebserver/src/main/kotlin/mockwebserver3/internal/duplex/MockStreamHandler.kt

              throw AssertionError("expected IOException")
            } catch (expected: IOException) {
            }
          }
        }
    
      @JvmOverloads
      fun sendResponse(
        s: String,
        responseSent: CountDownLatch = CountDownLatch(0),
      ) = apply {
        actions += { stream ->
          stream.responseBody.writeUtf8(s)
          stream.responseBody.flush()
          responseSent.countDown()
        }
      }
    
      fun exhaustResponse() =
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 3.2K bytes
    - Viewed (0)
  5. okhttp/src/test/java/okhttp3/DispatcherTest.kt

        assertThat(dispatcher.queuedCalls())
          .containsExactlyInAnyOrder(a4, a5)
      }
    
      @Test
      fun synchronousCallAccessors() {
        val ready = CountDownLatch(2)
        val waiting = CountDownLatch(1)
        client =
          client.newBuilder()
            .addInterceptor(
              Interceptor { chain: Interceptor.Chain? ->
                try {
                  ready.countDown()
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Fri Apr 05 03:30:42 GMT 2024
    - 12.7K bytes
    - Viewed (0)
  6. okhttp-android/src/androidTest/kotlin/okhttp3/android/AndroidAsyncDnsTest.kt

    import assertk.assertions.isEqualTo
    import assertk.assertions.isNotEmpty
    import assertk.assertions.isNull
    import assertk.fail
    import java.net.InetAddress
    import java.net.UnknownHostException
    import java.util.concurrent.CountDownLatch
    import mockwebserver3.MockResponse
    import mockwebserver3.junit4.MockWebServerRule
    import okhttp3.AsyncDns
    import okhttp3.HttpUrl.Companion.toHttpUrl
    import okhttp3.OkHttpClient
    import okhttp3.Request
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 5.7K bytes
    - Viewed (0)
  7. okhttp/src/main/kotlin/okhttp3/AsyncDns.kt

     * limitations under the License.
     *
     */
    
    package okhttp3
    
    import java.net.InetAddress
    import java.net.UnknownHostException
    import java.util.concurrent.CountDownLatch
    import okio.IOException
    
    /**
     * An async domain name service that resolves IP addresses for host names.
     *
     * The main implementations will typically be implemented using specific DNS libraries such as
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Tue Jan 23 14:31:42 GMT 2024
    - 3.5K bytes
    - Viewed (0)
  8. okhttp/src/test/java/okhttp3/AutobahnTester.kt

     * See the License for the specific language governing permissions and
     * limitations under the License.
     */
    package okhttp3
    
    import java.util.concurrent.CountDownLatch
    import java.util.concurrent.TimeUnit
    import java.util.concurrent.atomic.AtomicLong
    import java.util.concurrent.atomic.AtomicReference
    import okhttp3.internal.USER_AGENT
    import okio.ByteString
    
    /**
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 4.6K bytes
    - Viewed (0)
  9. okhttp/src/test/java/okhttp3/FastFallbackTest.kt

    import assertk.assertions.isEqualTo
    import java.io.IOException
    import java.net.Inet4Address
    import java.net.Inet6Address
    import java.net.InetAddress
    import java.net.Socket
    import java.util.concurrent.CountDownLatch
    import java.util.concurrent.TimeUnit
    import javax.net.SocketFactory
    import kotlin.test.assertFailsWith
    import mockwebserver3.MockResponse
    import mockwebserver3.MockWebServer
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 10.3K bytes
    - Viewed (0)
  10. mockwebserver/src/test/java/mockwebserver3/CustomDispatcherTest.kt

     */
    package mockwebserver3
    
    import assertk.assertThat
    import assertk.assertions.isEqualTo
    import java.io.IOException
    import java.net.HttpURLConnection
    import java.util.concurrent.CountDownLatch
    import java.util.concurrent.atomic.AtomicInteger
    import org.junit.jupiter.api.BeforeEach
    import org.junit.jupiter.api.Test
    import org.junit.jupiter.api.Timeout
    
    @Timeout(30)
    class CustomDispatcherTest {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 3.3K bytes
    - Viewed (0)
Back to top