EventLoopPreference

public struct EventLoopPreference
extension HTTPClient.EventLoopPreference: CustomStringConvertible

Specifies how the library will treat event loop passed by the user.

  • Event Loop will be selected by the library.

    Declaration

    Swift

    public static let indifferent: HTTPClient.EventLoopPreference
  • The delegate will be run on the specified EventLoop (and the Channel if possible).

    This will call the configured delegate on eventLoop and will try to use a Channel on the same EventLoop but will not establish a new network connection just to satisfy the EventLoop preference if another existing connection on a different EventLoop is readily available from a connection pool.

    Declaration

    Swift

    public static func delegate(on eventLoop: EventLoop) -> EventLoopPreference
  • The delegate and the Channel will be run on the specified EventLoop.

    Use this for use-cases where you prefer a new connection to be established over re-using an existing connection that might be on a different EventLoop.

    Declaration

    Swift

    public static func delegateAndChannel(on eventLoop: EventLoop) -> EventLoopPreference
  • Declaration

    Swift

    public var description: String { get }