oksse | extension library for OkHttp to create a Server-Sent Event | Notification library

 by   heremaps Java Version: 0.9.0 License: Apache-2.0

kandi X-RAY | oksse Summary

kandi X-RAY | oksse Summary

oksse is a Java library typically used in Messaging, Notification applications. oksse has no bugs, it has no vulnerabilities, it has build file available, it has a Permissive License and it has low support. You can download it from GitHub.

OkSse is an extension library for OkHttp to create a Server-Sent Event (SSE) client. Server-sent events is a standard describing how servers can initiate data transmission towards clients once an initial client connection has been established. They are commonly used to send message updates or continuous data streams to a client.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              oksse has a low active ecosystem.
              It has 194 star(s) with 22 fork(s). There are 14 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 6 open issues and 11 have been closed. On average issues are closed in 16 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of oksse is 0.9.0

            kandi-Quality Quality

              oksse has 0 bugs and 0 code smells.

            kandi-Security Security

              oksse has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              oksse code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              oksse is licensed under the Apache-2.0 License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              oksse releases are available to install and integrate.
              Build file is available. You can build the component from source.
              Installation instructions are not available. Examples and code snippets are available.
              oksse saves you 169 person hours of effort in developing the same functionality from scratch.
              It has 419 lines of code, 33 functions and 6 files.
              It has medium code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed oksse and discovered the below as its top functions. This is intended to give you an instant insight into oksse implemented functionality, and help decide if they suit your requirements.
            • Creates a new server sent event
            • Performs a retry
            • Enqueues a call to the service
            • Prepares the HTTP call
            • Initial connect method
            • Opens the SSE
            • Notifies the failure
            • Closes the call
            • Sets the read timeout
            Get all kandi verified functions for this library.

            oksse Key Features

            No Key Features are available at this moment for oksse.

            oksse Examples and Code Snippets

            No Code Snippets are available at this moment for oksse.

            Community Discussions

            QUESTION

            How do I disconnect a OkHttp3 sse connection?
            Asked 2019-Oct-16 at 12:35
            Problem:

            I'm trying to create a client that can receive events from a server using SSE (server-sent events) and I'm using OkHttp3 to do that, combined with the OkHttp3-sse library (com.squareup.okhttp3:okhttp:4.1.0 & com.squareup.okhttp3:okhttp-sse:4.1.0). I am able to connect to the server and receive the events just fine, but at some point in time, I want to disconnect the client and shutdown my application. That is were the problem is. The connection gets closed, but the application is not shutting down, probably due to the ConnectionPool not closing.

            Attempted:

            As there is hardly any documentation on the use of the OkHttp3-sse library, I have tried to reverse engineer from the code what to do. I have tried to:

            • call RealEventSource.cancel() which is disconnecting, but is hanging on a thread
            • call OkHttpClient.dispatcher().cancelAll() which is also disconnecting, but remains hanging on a thread
            • call Response.close() which is passed to EventSourceListener.onOpen()
            Finding:

            As an alternative, I have looked at https://github.com/heremaps/oksse which has the RealServerSentEvent.close() call which is doing what I expect. It closes the connection and stops all threads allowing the application to shutdown completely. I have looked at the implementation of the RealServerSentEvent class to see how the implementation differs from RealEventSource. I think the difference is in the conditions of the read loop:

            RealEventSource line https://github.com/square/okhttp/blob/master/okhttp-sse/src/main/java/okhttp3/internal/sse/RealEventSource.kt#L75:

            ...

            ANSWER

            Answered 2019-Oct-08 at 22:41

            You're using the API correctly and OkHttp should be causing the read to fail with an IOException when the call is canceled. Obviously this isn't happening which I read as a bug in OkHttp.

            Next steps: report the bug to OkHttp. If you can do so with an executable test case I'll make sure this gets fixed real soon.

            Source https://stackoverflow.com/questions/58292351

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install oksse

            You can download it from GitHub.
            You can use oksse like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the oksse component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/heremaps/oksse.git

          • CLI

            gh repo clone heremaps/oksse

          • sshUrl

            git@github.com:heremaps/oksse.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Notification Libraries

            push.js

            by Nickersoft

            server

            by gotify

            fsnotify

            by fsnotify

            noty

            by needim

            gorush

            by appleboy

            Try Top Libraries by heremaps

            harp.gl

            by heremapsTypeScript

            tin-terrain

            by heremapsC++

            pptk

            by heremapsC++

            here-covid-19-tracker

            by heremapsJavaScript

            flatdata

            by heremapsPython