ayvango
ayvango

Reputation: 5977

How to store pure scala code

I'd like to use pure scala code (without side effects) as a immutable message for akka actor system. What form should I translate scala code to? Is the string representation the only correct method?

Upvotes: 2

Views: 162

Answers (1)

Viktor Klang
Viktor Klang

Reputation: 26589

You can simply send a scala.FunctionX as a message.

object Foo {
  val f = (s: String) => s.toInt
}

someActor ! Foo.f

Upvotes: 4

Related Questions