inakianduaga / scala-image-processor

Small toy demo to compare multithreaded vs single-thread image conversion in Scala
http://scala-image-processor.herokuapp.com/
MIT License
1 stars 0 forks source link

Add sqlite db w/ slick for saving report info #7

Closed inakianduaga closed 8 years ago

inakianduaga commented 8 years ago

Heroku has a 30 sec maximum execution time, so we need to make the processing async and keep state in a db

https://gist.github.com/larste/6683694

inakianduaga commented 8 years ago

Update: Better use websockets

Actually if we use websockets we can push the report results over the websocket, and we wouldn't need the database. This should be quite simple and with almost no changes to the frontend

https://www.playframework.com/documentation/2.4.x/ScalaWebSockets

Bacon.js for reactive websockets

http://blog.scottlogic.com/2014/07/23/frp-with-bacon-and-d3.html

inakianduaga commented 8 years ago

TODO:

Deprecated below

Scala examples

http://alvinalexander.com/scala/simple-scala-akka-actor-examples-hello-world-actors

Looking up actors

Since each actor has a path (unique), we can search for it by doing

import play.api.libs.concurrent.Akka 
import play.api.Play.current

// some code
val what = Akka.system.actorSelection("some path")

and presumably we can use that to tell the actor to do something

We should also be able to retrieve the name of a given actor

inakianduaga commented 8 years ago

Update:

Check typesafe's activator ReactiveMaps project that explains the actor & websocket