Building42 / Telegraph

Secure Web Server for iOS, tvOS and macOS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

custom qos for OperationQueue

Burningdust21 opened this issue · comments

Hey,

I am currently working on a project that requires highly intense CPU computation. After running for a while, the OperationQueue is no longer scheduled, task are enqueued but never executed.

The problem can be solved by specifying a high qos for OperationQueue. Is it possible to add an init function that takes an qos and set it to OperationQueue:

  /// Initializes a unsecure Server instance with custom quality of service
  public init(qualityOfService: QualityOfService) {
    workerQueue.qualityOfService = qualityOfService
  }

Hi @Burningdust21, unfortunately because of work and a never ending list of home improvement projects I don't have a lot of time to spend on Telegraph right now.

If you would like to open a PR, I would be happy to have a look at it when I can.

Perhaps we could even consider just making the workerQueue public. That would give some flexibility in configuring the OperationQueue. See: https://github.com/Building42/Telegraph/blob/main/Sources/Server/Server.swift