Skip to content

10.9 Compatibility #4

@bdkjones

Description

@bdkjones

Hi Ben,

I talked with an Apple Engineer today about the effects that the new App Nap API will have on background apps in 10.9. Essentially, the system is going to "intelligently" throttle the resources available to apps that are in the background so that they are de-prioritized on the CPU.

According to this engineer, this will primarily affect NSTimers and polling operations. The reason I bring this up is that BLWebSocketsServer uses polling. Given that 10.9 is going to drop the hammer on apps that use polling, I figured it would be a good time to get this library off of it, if possible.

I understand your class pretty well, but I'm not familiar with libwebsockets and the associated API. So forgive me if this is a dumb question, but why is the polling necessary? You're just checking to see if "messagesCount" is greater than 0, then calling down to libwebsockets. Why not use KVO to simply observe changes to the "messagesCount" property? When it changes, check it, if it's greater than 0, fire the call to libwebsockets. Alternately, have the -enqueueMessage methods trigger a call to libwebsockets once they complete.

I thought of modifying your code to try this, but then I figured you must have had a good reason to fall back on polling, so I'm probably missing some idiosyncrasy with libsockets.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions