Mariuxtheone / Teleport

Data Sync & Messaging Library for Android Wear
370 stars 47 forks source link

Does the usage of ASyncTask really necessary? #24

Closed tasomaniac closed 9 years ago

tasomaniac commented 9 years ago

I decided to use this cool library. But when I saw ASyncTask, I said what is going on? Why do we need our own ASyncTask?

Then, when I look at the internal code, I saw that doInBackground functions does not do anything at all. They just pass the parameter.

thedamfr commented 9 years ago

It's used to make sure that you are on the main thread. But you can use Callbacks instead.

tasomaniac commented 9 years ago

There are other ways to ensure that it is on the main thread. Callback function can be called on the main thread.

And lastly, in the advanced section of the wiki, it says that if you use Callback method, you have to deal with background threading. You say the opposite here.

On Wed, Apr 15, 2015, 11:38 PM Damien Cavaillès notifications@github.com wrote:

It's used to make sure that you are on the main thread. But you can use Callbacks instead.

— Reply to this email directly or view it on GitHub https://github.com/Mariuxtheone/Teleport/issues/24#issuecomment-93562275 .

thedamfr commented 9 years ago

I wrote the advanced section. And I'm not saying the opposite.

If you don't use the doInBackground method and don't care about threading, then the Callback is enough. That's my point.