huiping192 / HPRTMP

HPRTMP is a Swift library for RTMP streaming, with an easy-to-use API, efficient message handling, and robust error recovery.
MIT License
16 stars 3 forks source link

suspend PriorityQueue when no message is available(fix #14) #15

Open karino2 opened 3 months ago

karino2 commented 3 months ago

Now PriorityQueue::deque() becomes async and always return MessageContainer and never return nil. When no message is available, sleep with withCheckedContinuation until new message is comming.

With this change, HPRTMPExample CPU load becomes 14% for my iPhone 14 pro (previous: more than 100%).