Commit Graph
18 Commits
Author SHA1 Message Date
Johannes Weiss dfd25bf576 refactor Channel initialisation & *Bootstrap docs 2017-12-13 15:42:54 +00:00
Johannes Weiss 69c0cd463b fix random typos 2017-12-12 11:37:07 +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
Norman Maurer 6d7928beb2 Remove ; from the code 2017-11-06 21:53:30 +01:00
Norman Maurer 9c7829a065 Port IdleStateHandler from Netty 2017-10-29 09:46:48 +01:00
Johannes Weiss 1adb581f59 remove more Foundation imports 2017-10-10 16:25:43 +01:00
Johannes Weiß c09178ceb2 baby steps towards a type-safe Channel pipeline 2017-06-30 13:04:19 +01: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 ab5297365a Use whenComplete(...) if interested in error and success case 2017-06-28 08:14:46 +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 57cd379950 More consistent handling of writable state changes, so it matches netty 2017-06-19 15:05:29 +02:00
Johannes Weiß ecbda69fa9 fix pipeline stall (when no reads were happening and write returned EWOULDBLOCK) 2017-06-16 17:46:50 +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
Johannes Weiß cd4bb67138 make compatible with Swift 4 compiler (in Swift 3 mode) 2017-06-02 18:25:33 +01:00
Norman Maurer c8eb940aa7 Add support for running multiple EventLoops 2017-05-30 14:09:02 +02:00
Norman Maurer f933093a1e Introduce ServerSocketChannel which will accept SocketChannel instances. Now the ServerSocket and the Socket are both handled directly via the EventLoop and make use of the pipeline just like in Netty. 2017-05-23 14:53:21 +02:00
Norman Maurer d462b007d7 Remove backpressure handling from Channel itself and implement it in a generic ChannelHandler, this makes it more flexible for the user what to do 2017-05-17 09:40:44 +02:00