vendredi 20 février 2015

Scala - Traversing a ByteString Until Empty


Vote count:

0




Is there a more concise and/or performant way to traverse the message than what I have here?



import akka.util.ByteString

def nextValue(message: ByteString): (ByteString, ByteString)

def processFields(message: ByteString): Unit = nextValue(message) match {

case (_, Empty) => // Complete Parsing

case (value, rest) =>
// Do work with value

// loop
processFields(rest, fieldMap.tail)
}


asked 1 min ago

BAR

1,548






Scala - Traversing a ByteString Until Empty

Aucun commentaire:

Enregistrer un commentaire