delight-im / Android-DDP

[UNMAINTAINED] Meteor's Distributed Data Protocol (DDP) for clients on Android
Apache License 2.0
274 stars 54 forks source link

Callbacks run on the main thread #122

Closed paceraudio closed 7 years ago

paceraudio commented 7 years ago

Hi,

I notice that the callbacks always seem to be running on the main thread, even if set up in a separate thread in a Service, or an Intent Service.

ocram commented 7 years ago

Thanks for your feedback!

I notice that the callbacks always seem to be running on the main thread

Yes, this is correct.

This is intended behavior and has been a deliberate choice, as you can see here: https://github.com/delight-im/Android-DDP/blob/103a8927d3620a4696a417a5ae8c193041f1767d/Source/library/src/main/java/im/delight/android/ddp/CallbackProxy.java#L28

Is there anything wrong with this?