4

Here is what i did:

  • Created a custom downloader (extends OkHttpDownloader) and assigned it to Picasso.
  • Inside the downloader, i added an interceptor ( getClient().interceptors().add(new Interceptor() {...})

I launched my Android app in debug mode, i noticed there are two threads, each appropriately named "Picasso-....". When i try to access an image from the web, each of these threads calls the public Response intercept(Chain chain) method of my interceptor, meaning that the same request is processed by more than one thread simultaneously. What's the reason behind this?

Eric Cochran
  • 8,414
  • 5
  • 50
  • 91
my chalupa
  • 137
  • 11

1 Answers1

0

Thanks Gavriel for getting me to do something as simple as setting up a very rudimentary Picasso setup and actually do my homework, i.e. experiment with it a bit. Anyhow. I discovered that doing:

picasso.setIndicatorsEnabled(true); and/or picasso.setLoggingEnabled(true);

actually created another thread (for I guess managing this kind of debug info?). This was confusing the hell out of me - the two threads really do execute my request once each. Very confusing, but whatever. I guess it's done asynchronously, would make sense for the logging anyway. Any idea, though, why that second thread would execute my image request?

my chalupa
  • 137
  • 11