-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
clean up the rest of the codecs, tests.
- Loading branch information
Showing
10 changed files
with
93 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 21 additions & 15 deletions
36
finagle-stream/src/main/scala/com/twitter/finagle/stream/Stream.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,34 @@ | ||
package com.twitter.finagle.stream | ||
|
||
import com.twitter.finagle.Codec | ||
import com.twitter.finagle.{Codec, ClientCodec, ServerCodec} | ||
import org.jboss.netty.channel._ | ||
import org.jboss.netty.handler.codec.http.{HttpServerCodec, HttpClientCodec, HttpRequest} | ||
import org.jboss.netty.buffer.ChannelBuffer | ||
|
||
object Stream extends Stream | ||
|
||
class Stream extends Codec[HttpRequest, com.twitter.concurrent.Channel[ChannelBuffer]] { | ||
override val serverPipelineFactory = new ChannelPipelineFactory { | ||
def getPipeline = { | ||
val pipeline = Channels.pipeline() | ||
pipeline.addLast("httpCodec", new HttpServerCodec) | ||
pipeline.addLast("dechannelize", new ChannelToHttpChunk) | ||
pipeline | ||
override def serverCodec = | ||
new ServerCodec[HttpRequest, com.twitter.concurrent.Channel[ChannelBuffer]] { | ||
def pipelineFactory = new ChannelPipelineFactory { | ||
def getPipeline = { | ||
val pipeline = Channels.pipeline() | ||
pipeline.addLast("httpCodec", new HttpServerCodec) | ||
pipeline.addLast("dechannelize", new ChannelToHttpChunk) | ||
pipeline | ||
} | ||
} | ||
} | ||
} | ||
|
||
override val clientPipelineFactory = new ChannelPipelineFactory { | ||
def getPipeline = { | ||
val pipeline = Channels.pipeline() | ||
pipeline.addLast("httpCodec", new HttpClientCodec) | ||
pipeline.addLast("bechannelfy", new HttpChunkToChannel) | ||
pipeline | ||
override def clientCodec = | ||
new ClientCodec[HttpRequest, com.twitter.concurrent.Channel[ChannelBuffer]] { | ||
def pipelineFactory = new ChannelPipelineFactory { | ||
def getPipeline = { | ||
val pipeline = Channels.pipeline() | ||
pipeline.addLast("httpCodec", new HttpClientCodec) | ||
pipeline.addLast("bechannelfy", new HttpChunkToChannel) | ||
pipeline | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters