خرید بک لینک

Vote count: 0

I've been stuck on this small piece of code for 2 days now and I don't understand what I'm doing wrong.

class Header extends Serializable {
  val objectives = List[String]("1", "2", "3")

  var nominalCount = 0
  var inputCount = 0
  var outputCount = 0
  var methodType = ""

  override def toString: String = {
    s"NominalCount: $nominalCountn" +
    s"InputCount: $inputCountn" +
    s"OutputCount: $outputCountn" +
    s"Type: $methodTypen" +
    s"Objectives: ${objectives.toString}"
  }
}

I create an instance of this class, and send it to the ActorRef like you would with any type of message sender ! header

On the receiving end I have this.

class MethodActor extends Actor {
  val remote = context.actorSelection(s"akka.tcp://[email protected]:2552/user/MethodDelegate")

  def receive = {
    case h: Header =>
      println("HEADER RECEIVED")
      println(h.toString())
    case s: String => println(s)
  }
}

For some reason, my Header class is not being sent or received. But when I remove the val objectives declaration. It IS being sent.

Despite having var Integers and Strings, that works just fine. But collections of any kind don't work. I've tried Iterators, Collections, Maps, Vectors, Properties. Nothing works, so I must be doing something wrong.

asked 32 secs ago

(Why?)

برچسب: why am i so tired,why am i always tired,why am i always hungry,why am i so ugly,why am i always cold,why am i dizzy,why am i so gassy,why am i single,why am i depressed,why am i so angry, نویسنده: استخدام کار تاريخ: دوشنبه 8 شهريور 1395 ساعت: 15:08

صفحه بندی