Skip to content

Instantly share code, notes, and snippets.

@glidester
glidester / gist:9809206
Created March 27, 2014 14:49
Akka Actor per request in Play2 Controller
object BlackListController extends Controller {
val myActor = Akka.system.actorOf(Props[LicenceBlackList], name = "LicenceBlackListActor")
type OptionalBlacklistEntry = Option[BlacklistEntry]
def get(key: String) = Action.async {
//we will use this promise to create a future (read handle) which will be returned from this action. This future will complete when the promise is successfully populated with value
val p = Promise[Option[BlacklistEntry]]
@glidester
glidester / GensonIssue.scala
Created November 20, 2017 10:20
Genson Issue with selectively including class meta data into only polymorphic classes
import com.owlike.genson.{ GensonBuilder, ScalaBundle, ScalaGenson }
import org.scalatest.{ Matchers, WordSpecLike }
trait GenericType {
def providerId: Int
}
class SpecialisedTypeA(
val providerId: Int,
val sourceEntityId: String