EventLoopGroup

public protocol EventLoopGroup : AnyObject

Provides an endless stream of EventLoops to use.

  • Returns the next EventLoop to use.

    The algorithm that is used to select the next EventLoop is specific to each EventLoopGroup. A common choice is round robin.

    Declaration

    Swift

    func next() -> EventLoop
  • Shuts down the eventloop gracefully. This function is clearly an outlier in that it uses a completion callback instead of an EventLoopFuture. The reason for that is that NIO’s EventLoopFutures will call back on an event loop. The virtue of this function is to shut the event loop down. To work around that we call back on a DispatchQueue instead.

    Declaration

    Swift

    func shutdownGracefully(queue: DispatchQueue, _ callback: @escaping (Error?) -> Void)
  • Returns an EventLoopIterator over the EventLoops in this EventLoopGroup.

    Declaration

    Swift

    func makeIterator() -> EventLoopIterator

    Return Value

    EventLoopIterator