* 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(...)
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`
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)`
- 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