Skip to content

Instantly share code, notes, and snippets.

@gmanfunky
Created July 2, 2013 01:43
Show Gist options
  • Select an option

  • Save gmanfunky/5906207 to your computer and use it in GitHub Desktop.

Select an option

Save gmanfunky/5906207 to your computer and use it in GitHub Desktop.

Revisions

  1. gmanfunky created this gist Jul 2, 2013.
    19 changes: 19 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@

    //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
    })