ably / ably-cocoa

iOS, tvOS and macOS Objective-C and Swift client library SDK for Ably realtime messaging service
https://ably.com/download
Apache License 2.0
45 stars 24 forks source link

Callback-based API for fetching runloop #1546

Open maratal opened 1 year ago

maratal commented 1 year ago

What about if we made this a callback-based API instead, which, as well as not blocking, encapsulates the logic of waiting for the shared ARTSRRunLoopThread to start? Along the lines of

+ (void)ARTSR_fetchNetworkRunLoopWithCompletion:(void (^)())completionHandler queue:(dispatch_queue_t)callbackQueue /* the queue on which completionHandler should be called */;

and internally it would wait for a callback / notification which would be posted by ARTSRRunLoopThread after it populates its runLoop inside its -main method.

_Originally posted by @lawrence-forooghian in https://github.com/ably/ably-cocoa/pull/1538#discussion_r1035062291_

┆Issue is synchronized with this Jira Task by Unito

sync-by-unito[bot] commented 1 year ago

➤ Automation for Jira commented:

The link to the corresponding Jira issue is https://ably.atlassian.net/browse/SDK-3117