mirror of
https://github.com/apple/swift-nio
synced 2026-11-25 04:47:49 +00:00
allow EventLoopIterator to be constructed using [EventLoop] (#706)
Motivation: Modules outside of NIO core must be able to create `EventLoopIterator`s in order to conform to the `EventLoop` protocol, therefore we need an initialiser that's available. Modifications: add public initialiser to construct EventLoopIterator from [EventLoop] Result: others can implement EventLoops again
This commit is contained in:
1 parent
ee6534f627
commit
1ac199c195
1 file changed
+2
-1
@@ -155,7 +155,8 @@ public struct EventLoopIterator: Sequence, IteratorProtocol {
|
||||
public typealias Element = EventLoop
|
||||
private var eventLoops: IndexingIterator<[EventLoop]>
|
||||
|
||||
internal init(_ eventLoops: [EventLoop]) {
|
||||
/// Create an `EventLoopIterator` from an array of `EventLoop`s.
|
||||
public init(_ eventLoops: [EventLoop]) {
|
||||
self.eventLoops = eventLoops.makeIterator()
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user