Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
inakianduaga opened this issue Mar 9, 2016 · 3 comments
Closed

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

inakianduaga opened this issue Mar 9, 2016 · 3 comments
Labels

Comments

@inakianduaga
Copy link
Owner

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
Copy link
Owner Author

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
Copy link
Owner Author

TODO:

  • Modify actor creation to use the random websocket id available in the session.

Deprecated below

  • After connection, send from the server a websocket ID to the client that needs to be included in each request to get updates pushed back to the client (otherwise we need to do this using Session Ids)
  • Find a way to assign names to the actors we create, and to fetch actors by name as well (where name would be the unique id we want)

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 pushed a commit that referenced this issue Mar 14, 2016
@inakianduaga
Copy link
Owner Author

Update:

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant