Coder Social home page Coder Social logo

activator-akka-stream-scala's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

activator-akka-stream-scala's Issues

Update to M4

We need to update this template to akka-stream 1.0-m4

Can you port this to slick 2.1.x ?

I tried to simply change the dependency version, didn't work out of the box. I'm having some headache with 2.1.0 and this is the only full example out in the wild. Documentation provides just snippets.

Scalariform settings cause a change to the source from what’s in the repository

I haven't used Scalariform before, but it seems like meaningful assumption that sbt compile would not change the sources, from what's in the repo. Now it does.

  1. git clone
  2. sbt compile
$ git diff
diff --git a/src/main/scala/sample/stream/GroupLogFile.scala b/src/main/scala/sample/stream/GroupLogFile.scala
index d886c44..dcc7477 100644
--- a/src/main/scala/sample/stream/GroupLogFile.scala
+++ b/src/main/scala/sample/stream/GroupLogFile.scala
@@ -30,8 +30,8 @@ object GroupLogFile {
       via(Framing.delimiter(ByteString(System.lineSeparator), maximumFrameLength = 512, allowTruncation = true)).
       map(_.utf8String).
       map {
-        case line@LoglevelPattern(level) => (level, line)
-        case line@other => ("OTHER", line)
+        case line @ LoglevelPattern(level) => (level, line)
+        case line @ other                  => ("OTHER", line)
       }.
       // group them by log level
       groupBy(5, _._1).

GroupLogFile example closes file too early

It closes the file upon completion of the master stream, which has of course nothing to do with the completion of the individual groups writing (the master completes earlier). The proper solution is instead of using onComplete on the individual streams, just return the future, and call mapAsync(identity) on the master stream, and then register the onComplete(close()) call.

Reading resources using new File("src/main/resources/logfile.txt") is bad

I'm going to use the Akka Streams sample in our Helsinki Scala Club meetup. Unfortunately, one of the samples reads a resource using a build-time relative path. This only works in development, of course, and not in production. In fact, the current way is not using the file as a resource, at all. All of this might be misleading to Scala learners.

Unfortunately, I don't know how to fix this for real. Using a Stream instead of File changes the later iteration code.

Here is a code that is somewhere in between. Creates a File out of a resource. This is done pretty often, but is not ideal, or recommended. Better than the current way, though.

    // Note: Resources should be read using '.getResourceAsStream'. While the code shows Akka Streams, it should not
    //      teach bad (nonfunctional, in production) manners. AKa240116
    //
    //val log: InputStream = getClass.getResourceAsStream("/logfile.txt")

    // read lines from a log file
    val logFile: File = new File(getClass.getResource("/logfile.txt").toURI)

Backpressure example not working as expected

When I run WritePrimes.scala the numbers are appearing on the console faster than 1 number/second.
Also when I checked primes.txt there were always less numbers than in the console output.
Is there something I am missing?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.