Akka-HTTP-Akka-Streams-Akka-Actors-Integration | Streaming Chuck Norris jokes in JSON as Server

 by   calvinlfer Scala Version: Current License: No License

kandi X-RAY | Akka-HTTP-Akka-Streams-Akka-Actors-Integration Summary

kandi X-RAY | Akka-HTTP-Akka-Streams-Akka-Actors-Integration Summary

Akka-HTTP-Akka-Streams-Akka-Actors-Integration is a Scala library typically used in Programming Style applications. Akka-HTTP-Akka-Streams-Akka-Actors-Integration has no bugs, it has no vulnerabilities and it has low support. You can download it from GitHub.

The JokeFetcher Akka Actor is used to continuously poll the ICNDB endpoint behind the scenes and publish each discrete JSON response onto the Event Stream as a JokeEvent. The JokePublisher Akka Actor is a point of integration between Akka Actors and Akka Streams. The JokePublisher is created whenever a request to the /streaming-jokes endpoint which in turn creates an Akka Stream to stream the response back to the requester. It lives for the duration of that Stream and gets terminated once the Stream completes (does not happen in this case because it is an infinite Stream) or when the Stream is cancelled (happens when the requester does not want anymore data). As you can see the JokePublisher is tied to the duration of each Stream. This means if 6 users come in and request data from /streaming-jokes then 6 actors of JokePublisher will be created, each of them will be responsible for publishing data into that specific user's streaming response. The JokePublisher on creation, will subscribe to the Akka EventStream and listen for JokeEvents and send them downstream to provide streaming responses. As you can see, publishing messages to the JokePublisher Actor will end up in the Akka Stream which is why this is a point of integration between Akka Actors and Akka Streams when it comes to publishing data into the Akka Stream. This actor respects backpressure. It will only send information as fast as the downstream consumer can consume. It will drop messages if they are coming in too quickly. Users can hit the /streaming-jokes route in order to get back an SSE streaming JSON response of Chuck Norris jokes in JSON format.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              Akka-HTTP-Akka-Streams-Akka-Actors-Integration has a low active ecosystem.
              It has 58 star(s) with 8 fork(s). There are 5 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              Akka-HTTP-Akka-Streams-Akka-Actors-Integration has no issues reported. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of Akka-HTTP-Akka-Streams-Akka-Actors-Integration is current.

            kandi-Quality Quality

              Akka-HTTP-Akka-Streams-Akka-Actors-Integration has no bugs reported.

            kandi-Security Security

              Akka-HTTP-Akka-Streams-Akka-Actors-Integration has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              Akka-HTTP-Akka-Streams-Akka-Actors-Integration does not have a standard license declared.
              Check the repository for any license declaration and review the terms closely.
              OutlinedDot
              Without a license, all rights are reserved, and you cannot use the library in your applications.

            kandi-Reuse Reuse

              Akka-HTTP-Akka-Streams-Akka-Actors-Integration releases are not available. You will need to build from source code and install.
              Installation instructions are not available. Examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of Akka-HTTP-Akka-Streams-Akka-Actors-Integration
            Get all kandi verified functions for this library.

            Akka-HTTP-Akka-Streams-Akka-Actors-Integration Key Features

            No Key Features are available at this moment for Akka-HTTP-Akka-Streams-Akka-Actors-Integration.

            Akka-HTTP-Akka-Streams-Akka-Actors-Integration Examples and Code Snippets

            No Code Snippets are available at this moment for Akka-HTTP-Akka-Streams-Akka-Actors-Integration.

            Community Discussions

            Trending Discussions on Akka-HTTP-Akka-Streams-Akka-Actors-Integration

            QUESTION

            How can I create Server-side events from an EventStream in Akka?
            Asked 2017-Nov-30 at 00:19

            I tried: EventStream -> Source -> Akka HTTP (SSE)

            As I see it, this cannot work, because the source will be materialized by Akka HTTP complete(Source, ...) and to send messages from the EventStream to the materialized Source I need the ActorRef (is there a way to get that ActorRef?)

            I've found a solution on GitHub which uses ActorPublisher: https://github.com/calvinlfer/Akka-HTTP-Akka-Streams-Akka-Actors-Integration

            But since ActorPublisher is an internal API, I am still hoping for clean solution.

            ...

            ANSWER

            Answered 2017-Nov-30 at 00:19

            You can use Source.actorRef to create a Source that converts event stream elements to ServerSentEvent instances, and BroadcastHub.sink, in a manner like the following:

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

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

            Vulnerabilities

            No vulnerabilities reported

            Install Akka-HTTP-Akka-Streams-Akka-Actors-Integration

            You can download it from GitHub.

            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/calvinlfer/Akka-HTTP-Akka-Streams-Akka-Actors-Integration.git

          • CLI

            gh repo clone calvinlfer/Akka-HTTP-Akka-Streams-Akka-Actors-Integration

          • sshUrl

            git@github.com:calvinlfer/Akka-HTTP-Akka-Streams-Akka-Actors-Integration.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