Commit Graph
1096 Commits
Author SHA1 Message Date
Norman Maurer 829c0ccb9d Remove memory copy for each HTTP body part that is received 2017-07-09 13:25:43 +02: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
Norman Maurer 3d67e8da10 Remove duplicate asserts and assert that the Selectable is still open when used with the Selector 2017-07-07 10:52:37 +02:00
Norman Maurer ff1ab56ab2 Call pendingWrites.failAll(...) in a non delayed fashion to ensure closing of the Channel is reflected directly 2017-07-07 10:26:11 +02:00
Kevin Clark 145e8328c4 Futures init'd with errors/results are already fulfilled
* Futures init'd with errors/results are fulfilled

They automatically succeed/fail when new callbacks are added, so
semantically they're already fulfilled, no?

Without this, EventLoop.newSucceedFuture 'leaks' and explodes in the
provided tests.

* Regenerate linux tests

* Add missing generated extension for linux CI
2017-07-07 00:04:45 -07:00
Norman Maurer ef4cabc4b1 Ensure we not hold a lock while executing the tasks submitted to the EventLoop 2017-07-06 19:53:22 +02:00
Johannes Weiß 7467ab6a02 reduce dynamic type casting and checking 2017-07-06 18:47:15 +01:00
Norman Maurer 9d535bad22 Let writeInbound and writeOutbound signal if something was put in the buffer to consume and update the tests 2017-07-06 14:33:57 +02: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
Norman Maurer c12620e813 Directly use malloc/free when allocate ByteBuffer and also use realloc when change the size of the _Storage 2017-07-05 18:13:55 +02:00
Norman Maurer 6c06390909 Not call discardReadBytes() as this will produce an extra memory copy which is not needed as we rebuild the cumulation buffer anyway on the next message 2017-07-05 10:40:26 +02:00
Norman Maurer 354fd7f623 Use whenComplete(...) when register child channel 2017-07-04 21:04:51 +02:00
Norman Maurer 4b1bc0afa9 EventLoop.submit(...) should use newPromise() for its promise creation to make it easer to implement 2017-07-04 20:10:45 +02:00
Johannes Weiß c09178ceb2 baby steps towards a type-safe Channel pipeline 2017-06-30 13:04:19 +01:00
Norman Maurer 614f689e05 Improve the EmbeddedChannel to be able to easily capture inbound and outbound messages 2017-07-04 12:16:00 +02:00
Norman Maurer c2c5c70610 Correctly handle eventfd_write error and also wrap as syscall 2017-07-04 09:02:49 +02:00
Norman Maurer 4127580f8b Port MessageToByteEncoder from netty 2017-07-04 08:45:40 +02:00
Norman Maurer 540c74b4ac Small cleanup 2017-07-04 08:58:45 +02:00
Norman Maurer c601d7683b We not depend on the errno module anymore 2017-07-03 19:50:32 +02: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 6e55eb0ade Rename InterestedEvent to IOEvent and reuse it in SelectorEvent to make things more consistent 2017-07-03 13:24:02 +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 851296002e Simplify code and some cleanup 2017-07-02 09:12:16 +02:00
Norman Maurer c7dd20e9ba Cheaper way of creating fullfilled futures 2017-07-01 20:19:42 +02:00
Norman Maurer 21088d0680 Set maxMessagesPerRead to 4 as default value 2017-07-01 14:55:23 +02:00
Norman Maurer 29c00b59dd Reintroduce writeAndFlush as it makes things easier for users 2017-06-29 20:59:27 +02:00
Norman Maurer 815366c37c Add ByteToMessageDecoder which people can use to easy decode bytes to other messages 2017-06-29 16:52:38 +02:00
Johannes Weiss 2fa81c9df4 make ByteBuffer allocation non-throwing (no reason it threw) 2017-06-29 15:38:02 +01:00
Johannes Weiß cc9ecf2071 HTTP tests & fixes 2017-06-29 12:20:52 +01: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 ab5297365a Use whenComplete(...) if interested in error and success case 2017-06-28 08:14:46 +02:00
Johannes Weiß d85397d689 Endianness is spelt Endianness and not Endianess
see https://en.wikipedia.org/wiki/Endianness
2017-06-27 16:47:01 +01:00
Johannes Weiß d9daac64cc make registration type-safe 2017-06-27 15:58:22 +01: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 6ff93721d3 Correctly call fireErrorCaught when in the EventhLoop and bootstrap a server 2017-06-27 08:32:51 +02:00
Norman Maurer d111028ede Make use of Future.whenComplete(...) when we are interested in the failure and success case 2017-06-27 08:31:16 +02:00
Norman Maurer 05a1f1e602 Slim down the Future / Promise
The user should use callbacks to access the value / error of the promise or wait() and not try to get it directly. This also did not work correctly because it was not correctly implemented in terms of thread-safety
2017-06-26 20:42:37 +02:00
Norman Maurer 01e4eb512a Not try to re-register if already unregistered 2017-06-26 20:53:36 +02:00
Norman Maurer 23fef69586 Make Promise a struct for performance reasons.
Make the Promise a struct to improve performance. As the Promise only contains a reference it also not change any semantics for the user.

Before:

`Bandwidth per channel: 14367.103⇅ Mbps (1795887.9 kBps)`

After:

`Bandwidth per channel: 14772.899⇅ Mbps (1846612.4 kBps)`
2017-06-26 09:44:01 +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
Norman Maurer 02e54db9a3 Remove two methods from ChannelCore which are not needed 2017-06-22 20:39:21 +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 4c6d8f748e Remove code that is already provided by Channel extension 2017-06-22 17:06:46 +02:00
Norman Maurer ea78014e00 Add assert to check that used Promise was not completed yet 2017-06-22 14:50:55 +02:00