Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 23 for Kistner (0.69 sec)

  1. okhttp-sse/src/main/kotlin/okhttp3/sse/EventSources.kt

        return EventSource.Factory { request, listener ->
          val actualRequest =
            if (request.header("Accept") == null) {
              request.newBuilder().addHeader("Accept", "text/event-stream").build()
            } else {
              request
            }
    
          RealEventSource(actualRequest, listener).apply {
            connect(callFactory)
          }
        }
      }
    
      @JvmStatic
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Apr 06 04:18:15 GMT 2024
    - 1.6K bytes
    - Viewed (1)
  2. okhttp-sse/src/main/kotlin/okhttp3/sse/EventSource.kt

         * asynchronous process to connect the socket. Once that succeeds or fails, `listener` will be
         * notified. The caller must cancel the returned event source when it is no longer in use.
         */
        fun newEventSource(
          request: Request,
          listener: EventSourceListener,
        ): EventSource
      }
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.4K bytes
    - Viewed (0)
  3. docs/features/events.md

    ![Events Diagram](../assets/images/******@****.***)
    
    Here’s a [sample event listener](https://github.com/square/okhttp/blob/master/samples/guide/src/main/java/okhttp3/recipes/PrintEventsNonConcurrent.java) that prints each event with a timestamp.
    
    ```java
    class PrintingEventListener extends EventListener {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Feb 06 02:19:09 GMT 2022
    - 7.7K bytes
    - Viewed (0)
  4. okhttp/src/test/java/okhttp3/ServerTruncatesRequestTest.kt

      @RegisterExtension
      @JvmField
      var clientTestRule = OkHttpClientTestRule()
    
      private val listener = RecordingEventListener()
      private val handshakeCertificates = platform.localhostHandshakeCertificates()
    
      private var client =
        clientTestRule.newClientBuilder()
          .eventListenerFactory(clientTestRule.wrap(listener))
          .build()
    
      private lateinit var server: MockWebServer
    
      @BeforeEach
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 9.5K bytes
    - Viewed (0)
  5. samples/slack/src/main/java/okhttp3/slack/SlackApi.java

        }
      }
    
      /** See https://api.slack.com/rtm. */
      public WebSocket rtm(HttpUrl url, WebSocketListener listener) {
        return httpClient.newWebSocket(new Request.Builder()
            .url(url)
            .build(), listener);
      }
    
      static final class SlackJsonAdapters {
        @ToJson String urlToJson(HttpUrl httpUrl) {
          return httpUrl.toString();
        }
    
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Fri Jul 06 19:30:55 GMT 2018
    - 4.4K bytes
    - Viewed (1)
  6. okhttp-sse/src/test/java/okhttp3/sse/internal/EventSourceHttpTest.kt

            ).setHeader("content-type", "text/event-stream")
            .build(),
        )
        val source = newEventSource()
        assertThat(source.request().url.encodedPath).isEqualTo("/")
        listener.assertOpen()
        listener.assertEvent(null, null, "hey")
        listener.assertClose()
      }
    
      @RetryingTest(5)
      fun cancelInEventShortCircuits() {
        server.enqueue(
          MockResponse.Builder()
            .body(
              """
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Jan 14 10:20:09 GMT 2024
    - 6.6K bytes
    - Viewed (0)
  7. okhttp-sse/src/main/kotlin/okhttp3/sse/internal/RealEventSource.kt

            listener.onFailure(this, IOException("canceled"), response)
          } else {
            listener.onClosed(this)
          }
        }
      }
    
      private fun ResponseBody.isEventStream(): Boolean {
        val contentType = contentType() ?: return false
        return contentType.type == "text" && contentType.subtype == "event-stream"
      }
    
      override fun onFailure(
        call: Call,
        e: IOException,
      ) {
    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)
  8. okhttp-sse/src/main/kotlin/okhttp3/sse/EventSourceListener.kt

      ) {
      }
    
      /**
       * TODO description.
       *
       * No further calls to this listener will be made.
       */
      open fun onClosed(eventSource: EventSource) {
      }
    
      /**
       * Invoked when an event source has been closed due to an error reading from or writing to the
       * network. Incoming events may have been lost. No further calls to this listener will be made.
       */
      open fun onFailure(
        eventSource: EventSource,
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.5K bytes
    - Viewed (1)
  9. okhttp/src/test/java/okhttp3/AutobahnTester.kt

     */
    class AutobahnTester {
      val client = OkHttpClient()
    
      private fun newWebSocket(
        path: String,
        listener: WebSocketListener,
      ): WebSocket {
        val request =
          Request.Builder()
            .url(HOST + path)
            .build()
        return client.newWebSocket(request, listener)
      }
    
      fun run() {
        try {
          val count = getTestCount()
          println("Test count: $count")
    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)
  10. native-image-tests/src/main/kotlin/okhttp3/RunTests.kt

      return discovered.getEngineTestDescriptor(testEngine).descendants.toList()
    }
    
    /**
     * Builds the awkwardly package private TreePrintingListener listener which we would like to use
     * from ConsoleLauncher.
     *
     * https://github.com/junit-team/junit5/issues/2469
     */
    fun treeListener(): TestExecutionListener {
      val colorPalette =
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 5.3K bytes
    - Viewed (0)
Back to top