-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added parameters to configure queue priorities for the WebSocket #304
Conversation
2dfc339
to
54e0417
Compare
@daltoniam @acmacalister As #302 was merged, I'm reopening this pull request. Please review. |
Thanks! I can see how this might be helpful. One thought, is it required to have both a read and write queue? Do you independently set the QOS of each? Only reason I ask is that the
|
@daltoniam Do you mean the write dispatch queue instead of the read dispatch queue? It looks to me that writes (not reads) are already limited by the operation queue. Assuming you meant writes, I agree with your first point. It looks like I can assign the underlying queue used by an OperationQueue object, so I can definitely consolidate everything related to writing to a single queue, with a single QOS. As for your second question: The sharedWorkQueue was used to synchronize attempts to cleanup the socket stream. After making the queue changes, I was noticing that Let me know if you'd like to go with a different approach. I could see how a lock could be used in this case. Or perhaps I could force all cleanups to either the write queue or read queue. |
@Elethier ah yes, I meant the write queue, apologizes on the mix up. Consolidate would be perfect. Second point is ignorable then 😄. Thanks! |
feb1647
to
2c9b311
Compare
2c9b311
to
2c1bf1e
Compare
Closing in favor of #326. |
Due to the amount of data coming in through the web sockets in our app, I had to make some changes so I could dynamically adjust the priority of the web socket queues. I'm not sure if this will be useful for every user of the library, but I don't think it hurts anything. (I can't tell for sure, because most of the tests fail on my machine, as described in issue #297.)
There also was a race condition in cleanupStream that I fixed. The race condition occurred very rarely without this changes, but it turns up more often with these changes, so I had to add to for stability's sake.
Please review: @daltoniam @acmacalister