Created
July 29, 2014 00:17
-
-
Save j14159/d5355107ebb0aad59930 to your computer and use it in GitHub Desktop.
untested, see blog post http://noisycode.com/blog/2014/07/27/akka-and-jdbc-to-services/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val pool = new BoneCP(config) | |
val getConn = () => pool.getConnection() | |
val relConn = (c: Connection) => pool.releaseConnection(c) | |
class MyActor(get: () => Connection, rel: (c: Connection) => Unit) extends Actor { | |
lazy val c = get() | |
override def preRestart(why: Throwable, msg: Option[Any]): Unit = { | |
rel(c) | |
} | |
def receive = ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment