Kqueue

public struct Kqueue: FileDescriptor

Darwin only. Kqueue implements the Darwin kqueue mechanism. See kqueue(2).

  • The file descriptor of this kqueue instance.

    Declaration

    Swift

    public let fileDescriptor: Int32
  • Creates a kqueue instance.

    Declaration

    Swift

    public init() throws
  • Polls for and returns available events in events. Events in changes are first added, updated or removed as requested by the event’s flags. The call blocks if no events are immediately available. If timeout is set, unblocks after this delay if no events are available. Returns the number of events available. No more than events.count events will be returned.

    Declaration

    Swift

    public func poll(with changes: [Kevent], into events: inout [Kevent], timeout: TimeInterval? = nil) throws -> Int
  • Releases the resources for this file descriptor.

    Declaration

    Swift

    public func close() throws