Commit Graph
60 Commits
Author SHA1 Message Date
Johannes Weiss 246bd7e56f EventLoop and EventLoopGroup should be class bound 2018-01-04 17:41:10 +00:00
Johannes Weiß 94e1af5452 compile warning-free on Swift 4.1 2017-12-18 15:37:57 +00:00
Johannes Weiß 25f4e2ceff PriorityQueue: make it work for partial orders 2017-12-12 11:13:33 +00:00
Johannes Weiss 64a1c2feb8 Channel writes: unit tests & lots of fixes 2017-12-11 12:20:46 +00:00
Norman Maurer 2bfd69b980 Add docs for EventLoop
* Add docs for EventLoop

* Address comments
2017-12-05 13:54:12 +01:00
Johannes Weiss 8335b6c3a0 replace priority queue 2017-11-28 16:13:26 +00:00
Johannes Weiß 06f9b1d63b merge ConcurrencyHelpers 2017-11-21 18:32:33 +00:00
Johannes Weiß 33fe401322 rename Future/Promise to EventLoopFuture/EventLoopPromise 2017-11-21 17:41:36 +00:00
Max (Swift) Moiseev 198d6b447b Explicit access modifiers on members in extensions 2017-11-18 04:40:26 -08:00
Max Moiseev 01b28a3f6d Simplify logic in guards (replace some with ifs instead) 2017-11-16 17:29:35 -08:00
Cory Benfield 1cb736e370 Catch bugs with sync shutdown 2017-11-10 17:28:52 +00:00
Johannes Weiß 31cd14eaad fix inEventLoop race and makes TSan happy 2017-11-10 14:56:33 -08:00
Norman Maurer 9c7829a065 Port IdleStateHandler from Netty 2017-10-29 09:46:48 +01:00
Johannes Weiss 3bef8a4012 turn import Foundation comments into code :) 2017-10-12 16:33:50 +01:00
Johannes Weiss 1adb581f59 remove more Foundation imports 2017-10-10 16:25:43 +01:00
Cory Benfield 3b40563a5e Prevent hot loop starving I/O 2017-10-09 18:14:49 -07:00
Johannes Weiß 8e06697362 fix EventLoop shutdown by introducing shutdownGracefully 2017-09-20 17:15:06 +01:00
Johannes Weiß 1b46d7c4ba fix ScheduledTask's Comparable implementation 2017-09-20 17:57:31 +01:00
Johannes Weiss 6721d46b9d make scheduling tasks on the EventLoop compatible with the tail call syntax 2017-09-18 16:24:08 +01:00
Norman Maurer ca7aac3253 Allow to cancel scheduled tasks 2017-08-18 14:07:17 +02:00
Norman Maurer 351d7c40d5 Cleanup code and remove old comments 2017-08-17 19:29:11 +02:00
Norman Maurer b2405eac44 Add support to schedule tasks on the EventLoop 2017-08-17 13:50:32 +02:00
Norman Maurer 4f91fe3f65 Fix possible infinite recursive loop when deregistering from the Selector throws an error while in close0 method 2017-08-16 19:36:50 +02:00
Johannes Weiß 06ff146839 fix missing autoreleasepool & faster string -> bytes 2017-07-17 17:57:15 +01: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
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
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 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 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
Johannes Weiß d9daac64cc make registration type-safe 2017-06-27 15:58:22 +01:00
Norman Maurer cb7850de08 Remove type argument for creating promise / future via EventLoop 2017-06-27 11:09:46 +02:00
Norman Maurer 02e54db9a3 Remove two methods from ChannelCore which are not needed 2017-06-22 20:39:21 +02:00
Kevin Clark 474ddadf00 Perf optimizations
* Remove unneeded hashValue from Future

And use Lock instead of NSLock. Seeing modest perf improvements.

* Annotate Promise and Future with final

* Use pthread_self equality rather than Thread

Seeing a 5x speedup in microbenchmarks
2017-06-16 02:11:27 -07:00
Johannes Weiß ba791a0ed5 new byte buffer 2017-06-12 17:42:07 +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 cd4866152d No need to allocate and free the iovec array all the time as we can just pin it on the EventLoop 2017-06-08 15:45:48 +02: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
Johannes Weiß 2d97c8c25d make the selector ready function take a closure instead of returning array 2017-06-02 17:34:08 +01:00
Norman Maurer 29b4ad373b Correctly distribute work across EVentLoops 2017-06-01 17:59:50 +02:00
Norman Maurer c8eb940aa7 Add support for running multiple EventLoops 2017-05-30 14:09:02 +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 49733ebccf Introduce SelectorStrategy which allows different kinds of select events. This will be needed later on 2017-05-24 11:56:29 +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 66c02bf30b Ensure the EventLoop is currently only accessed from the same thread 2017-05-18 08:58:47 +02:00
Norman Maurer 4b4c3c2dbd Simplify eventloop handling 2017-05-15 22:42:36 +02:00
Norman Maurer 18a844a633 Cleaner handling for registering for InterestedEvents 2017-05-15 22:32:52 +02:00
Norman Maurer 13b7b61b9a Ensure we correctly handle EOF when read and also that we never re-register when the Channel was closed 2017-05-15 20:26:07 +02:00
Norman Maurer a4fc805685 Ensure we not re-register on the eventLoop once the channel was already closed 2017-05-15 19:32:08 +02:00