Commit Graph
72 Commits
Author SHA1 Message Date
Johannes Weiss d2b671da66 make HTTPServerClientTests more robust 2018-01-05 15:19:22 +00:00
Johannes Weiß eaf658691c some grammar fixes 2017-12-19 15:23:26 +00:00
Norman Maurer 4f2c5234df Add docs for ChannelPipeline (mostly copied from netty as it was really good and complete). 2017-12-14 08:27:19 +01:00
Johannes Weiss 9bfea063a0 ChannelHandlerContext docs 2017-12-13 16:54:53 +00:00
Johannes Weiß e1b30f0a3d fix Channel writes 2017-12-05 17:08:42 +00:00
Johannes Weiß 33fe401322 rename Future/Promise to EventLoopFuture/EventLoopPromise 2017-11-21 17:41:36 +00:00
Max Moiseev 01b28a3f6d Simplify logic in guards (replace some with ifs instead) 2017-11-16 17:29:35 -08:00
Johannes Weiss 09b8925591 make ChannelHandlerCtx operations not crash if channel is already closed 2017-11-17 14:57:25 +00:00
Johannes Weiß 6173bee782 Split IOData into NIOAny & IOData (ByteBuffer | FileRegion) 2017-10-25 19:31:27 +01:00
Johannes Weiss 1adb581f59 remove more Foundation imports 2017-10-10 16:25:43 +01:00
Johannes Weiß 3ea35268d4 fully close Channel before firing channelInactive/Unregistered 2017-09-15 18:29:20 +01:00
Johannes Weiss 69765f58d6 refactor already closed errors 2017-09-15 18:18:22 +01:00
Cory Benfield bcdbe4bc46 ChannelHandlerContext.connect shouldn't bind 2017-09-15 09:29:59 +01:00
Norman Maurer 91b652fe8b Remove weak keywords as we nil out the pipeline reference when remove the context from the pipeline 2017-07-07 17:21:37 +01:00
Norman Maurer a28b1eb8d2 Tighten up access rights to methods 2017-07-07 17:30:42 +01:00
Johannes Weiß 7467ab6a02 reduce dynamic type casting and checking 2017-07-06 18:47:15 +01:00
Norman Maurer 2d235020d0 Add EmbeddedChannel.writeInbound|Outbound methods which make it easier to use EmbbeddedChannel for testing etc 2017-07-06 11:08:48 +02:00
Johannes Weiß c09178ceb2 baby steps towards a type-safe Channel pipeline 2017-06-30 13:04:19 +01:00
Norman Maurer fd936557c4 Move Socket/* into NIO/ for max performance
Before:

`Bandwidth per channel: 18870.319⇅ Mbps (2358789.8 kBps)`

After:

`Bandwidth per channel: 21330.617⇅ Mbps (2666327.1 kBps)`
2017-07-03 14:52:09 +02:00
Norman Maurer 904150913d Add more remove(...) and context(...) methods to ChannelPipeline which allows to modify or retrieve stuff from the pipeline on the fly 2017-07-03 13:35:00 +02:00
Norman Maurer 55fad73cd6 Introduce triggerUserOutboundEvent as this is a feature that we noticed is missing from netty 2017-07-03 09:56:16 +02:00
Norman Maurer 29c00b59dd Reintroduce writeAndFlush as it makes things easier for users 2017-06-29 20:59:27 +02:00
Norman Maurer 164cf244ac Swifty bind and connect method signature 2017-06-29 13:08:32 +02:00
Norman Maurer a9acf251e4 Have read and flush take an optional promise as well.
* Make Channel.read(...) take an optional promise so its more inline with the rest of the outbound operations

* Also let flush(...) take an optional promise and remove writeAndFlush(...)
2017-06-28 11:57:17 +02:00
Norman Maurer 06782bc0b3 Introduce ChannelInvoker and let ChannelPipeline and ChannelHandlerContext implement it.
- Move ChannelInboundInvoker and ChannelOutboundInvoker to ChannelInvoker
- Add ChannelInvoker protocol which extends ChannelInboundInvoker and ChannelOutboundInvoker
- Let ChannelPipeline and ChannelHandlerContext implement ChannelInvoker
2017-06-28 11:47:47 +02:00
Norman Maurer f35fb80c7e Make the promise optional for outbound operations.
This change allows the user to use `nil` as promise for outbound operations. This is useful if the user is not really interested in the outcome of the operations as it save extra allocations and so make things faster.

Before:
`Aggregate bandwidth: 10464.620↓, 10465.091↑ Mbps`

After (with using nil as Promise):

`Aggregate bandwidth: 11283.322↓, 11284.157↑ Mbps`
2017-06-27 14:37:24 +02:00
Norman Maurer cb7850de08 Remove type argument for creating promise / future via EventLoop 2017-06-27 11:09:46 +02:00
Norman Maurer bea94aa2aa Not allow to add a ChannelHandler to the ChannelPipeline after the Channel was closed.
We should not allow to add a ChannelHandler to the ChannelPipeline after the Channel was closed, and so all handlers of the pipeline removed.
2017-06-26 08:57:45 +02:00
Johannes Weiß 9db082a615 fix channel pipeline order (outbound was swapped) 2017-06-22 18:49:11 +01:00
Norman Maurer f92c0a09b8 Make naming in ChannelCore more consistent and remove implementation detail from protocol 2017-06-22 17:25:11 +02:00
Norman Maurer ea78014e00 Add assert to check that used Promise was not completed yet 2017-06-22 14:50:55 +02:00
Norman Maurer dbb98eb905 Split ChannelHandler to ChannelInboundHandler and ChannelOutboundHandler
The mention change was done for performance reasons as often the user only either implement inbound or outbound operations per handler. The problem before was that we had to traverse the full list all the time even if the user was not really interested in either inbound or outbound events.

With this change we also split the doubly-linked-list into two linked-lists, one for inbound handlers and one for outbound handlers. This way we only need to traverse the handlers that are really interested in th event itself.

To give an idea about the impact of the change in terms of performance, here are some numbers.

Two ChannelInboundHandlers in the ChannelPipeline that do nothing and so just forward the events to the next handler in the pipeline:

Before:

`Bandwidth per channel: 18369.796⇅ Mbps (2296224.5 kBps)`

After:

`Bandwidth per channel: 20043.638⇅ Mbps (2505454.7 kBps)`
2017-06-21 14:35:33 +02:00
Norman Maurer f091d61576 Remove the overhead of the tail and head context in the ChannelPipeline by skip their ChannelHandler if no custom action must be taken.
Also move the readIfNeeded() logic to Channel as it really belongs there.

Before:

 `Bandwidth per channel: 19004.576⇅ Mbps (2375571.9 kBps)`

After:
 `Bandwidth per channel: 21851.957⇅ Mbps (2731494.6 kBps)`
2017-06-20 14:28:04 +02:00
Norman Maurer 57cd379950 More consistent handling of writable state changes, so it matches netty 2017-06-19 15:05:29 +02:00
Norman Maurer 2ca36ad86a Remove duplicated code and also remove @discardResult where it makes no sense 2017-06-16 13:14:23 +01:00
Johannes Weiß b73bfdab70 remove some existentials by specialising the data type (IOData) 2017-06-15 19:43:49 +01:00
Norman Maurer 58d0883b2d Fork Future-Swift and adjust it to ensure callback execution is always done on the EventLoop.
- Also remove all methods that use Dispatch for now as we not need these
- Ensure we will detect if the user calls a blocking method while on the EventLoop and crash to guard against deadlock
2017-06-12 13:44:10 +02:00
Norman Maurer c6685c3e7c Use types to allow the compile to specialize the methods 2017-06-09 15:47:10 +02:00
Norman Maurer fce361e337 Tighten up visibility to allow the optimizer doing a better job 2017-06-09 11:16:59 +02:00
Johannes Weiß 02ff223eba add faster (Static)String write path 2017-06-08 16:09:56 +01:00
Norman Maurer aa1f7d04ed Tighten up API and access rights 2017-06-07 11:15:06 +02:00
Kevin Clark 329b474f45 Initial impl of EmbeddedChannel 2017-06-05 16:59:51 -07:00
Norman Maurer 66b7a80888 Remove redundant assert checks 2017-06-02 10:46:00 +02:00
Norman Maurer 82309a5320 No need to check if in EventLoop if we already know this 2017-05-31 13:07:00 +02:00
Norman Maurer 13c0d1b672 Add a few more asserts to ensure we are really on the EventLoop 2017-05-30 14:27:40 +02:00
Norman Maurer cd67d7cd3b Use fast-path fire* methods when triggered from within the EventLoop thread 2017-05-30 14:22:26 +02:00
Norman Maurer c8eb940aa7 Add support for running multiple EventLoops 2017-05-30 14:09:02 +02:00
Norman Maurer ba57e459ba Remove internal as its the default anyway 2017-05-27 13:45:58 +02:00
Norman Maurer db2002840d Add Channel.connect(...) and needed methods to Socket to support connect. This will allow us to support client and server easily in the future. 2017-05-24 22:13:17 +02:00
Norman Maurer 22d827f2da Mark methods with @discardableResult when its ok to discard the returned value 2017-05-24 14:17:40 +02:00