Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am rwatts07 on github.
  • I am rtwatts07 (https://keybase.io/rtwatts07) on keybase.
  • I have a public key ASANHNKWZB-YjVh1oh85sAsVVyGfFnZaray1CRsKidms3go

To claim this, I am signing this object:

@rwatts07
rwatts07 / outline.org
Created November 28, 2012 21:11 — forked from daviscale/outline.org
Akka intro presentation

Actor Based Concurrency

Why actors?

Problem: Shared mutable variables/state

One solution: Isolated Mutability

Threads/Locks
Lots of work writing/debugging the “plumbing” rather than application logic
Easy to create deadlock and hard to recover from

Another Solution: Actors

Originally from Erlang
Developed in 1986 by Joe Armstrong
@rwatts07
rwatts07 / gist:2480610
Created April 24, 2012 15:27
Password validation
override lazy val password = new MappedPassword(this) {
private def validatePassword(passwordText: String): List[FieldError] = {
Password.validate(passwordText) match {
case Password.Error.Length => List(FieldError(this, Text(S.??("Password too short"))))
case Password.Error.Groups => List(FieldError(this, Text(S.??("Password must contain at least 3 different character classes"))))
case _ => Nil
}
}
override def validations = validatePassword _ :: super.validations