Changeset 261:ba0da978be55

Show
Ignore:
Timestamp:
04/30/2010 09:41:03 AM (4 months ago)
Author:
dcaoyuan
Branch:
default
Message:

cleanup

Location:
blogbird/src/main/scala/org/aiotrade/httpd
Files:
2 removed
3 modified

Legend:

Unmodified
Added
Removed
  • blogbird/src/main/scala/org/aiotrade/httpd/HttpdActors.scala

    r260 r261  
    9494    val handler = hostRouter(req.headers("Host")) 
    9595    // If the handler produces a reply, pass it on. 
    96     handler ! Process(req, None, _ match { 
    97         case Some(reply) => produce(reply) 
    98         case None => 
    99       }) 
     96    handler ! Process(this, req, None) 
    10097  } 
    10198} 
  • blogbird/src/main/scala/org/aiotrade/httpd/RequestHandle.scala

    r251 r261  
    88import TypedDataImplicits._ 
    99 
    10 case class Process(req: Request, reply: Option[Reply], callback: Option[Reply] => Unit) 
     10case class Process(sender: Producer[Reply], req: Request, reply: Option[Reply]) 
    1111 
    1212/** 
     
    2222  def act = loop { 
    2323    react { 
    24       case Process(req, reply, callback) =>  
     24      case Process(sender, req, reply) => 
    2525        val newReply = try { 
    2626          apply(req, reply) 
     
    3030            Some(Reply(req, 500, "Internal server error")) 
    3131        } 
    32          
    33         callback(newReply) 
     32 
     33        newReply foreach sender.produce 
    3434    } 
    3535  } 
  • blogbird/src/main/scala/org/aiotrade/httpd/coactors.scala

    r257 r261  
    3939   * Called by the coroutine's <code>run</code> method when it has produced a new output. 
    4040   */ 
    41   protected def produce(output: O) { 
     41  def produce(output: O) { 
    4242    consumer ! output 
    4343  }