Skip to content

Instantly share code, notes, and snippets.

@gmanfunky
Created July 2, 2013 01:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gmanfunky/5906207 to your computer and use it in GitHub Desktop.
Save gmanfunky/5906207 to your computer and use it in GitHub Desktop.
//this .observers is a scala.collection.immutable.$colon$colon according to IntelliJ reflection
Observable.localState(state).observers.foreach(o => {
//insert accountName into each record.
println(o) //works
val accountName = o.accountName // produces compile error
val newRecordsWithAccountName = ArrayBuffer.empty[Record]
newRecords.foreach(aRecord => {
//where i will make a new Record object which includes accountName value
//stuff
newRecordsWithAccountName += aRecord
})
//val msg = Crawler.CrawlResult(this, newRecords)
val msg = Crawler.CrawlResult(this, newRecordsWithAccountName)
logger.debug(this + " sending: " + msg + " -> " + o)
o ! msg
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment