PromiseKit icon indicating copy to clipboard operation
PromiseKit copied to clipboard

Backtrace not available for PromiseKit calls due to dispatch_async

Open programmerdave opened this issue 10 years ago • 2 comments

Since PromiseKit uses dispatch_async, it's difficult to get a backtrace to know who called the method for error logging. Has anyone else come across this issue?

programmerdave avatar Jul 07 '16 00:07 programmerdave

Try setting PMKSetDefaultDispatchQueue(zalgo), this will remove the use of dispatch_async when calling then without any other parameters. Do not do this in production code (see: http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony)

Probably it is possible for us to remove dispatch_async use when the then will complete on the current queue and a “queue-leap” has already occurred, so will leave this ticket open to track the research there.

mxcl avatar Jul 19 '16 23:07 mxcl

I have updated the documentation for PMK4 to suggest the above trick.

mxcl avatar Jul 25 '16 19:07 mxcl