You can assign your response to an instance variable, you just can not write this.variable inside onSuccess because that references the Receiver and not the real class that contains the async call. Just omit "this" and it should work.
If you want to be complete you could write it the long way "RealClass.this.variablename". I do this all the time in my async callbacks. But its only useful if you want to remember some information obtained by an async call.
If you really need to process the response you have to do it in the onSuccess method either directly or by calling a separate method (or by firing an event which is basically the same as calling a separate method).
If you really need to process the response you have to do it in the onSuccess method either directly or by calling a separate method (or by firing an event which is basically the same as calling a separate method).So If I have a callback that requires a value from another callback, I have to chain these callbacks? Could result in a pretty long callback chain...
Yes you have to use chaining or you introduce a new service method that does all the work in just one server request. If you have code flows like finding an ID_b for a given ID_a and then immediately use ID_b to fetch the final object you could create a specialized method that takes ID_a and directly fetches and returns the final object. Finding ID_b would then only happen on server side.I prefer the last option as I want to reduce server requests as much as possible.
If you have to chain then you should call good named methods in your callbacks onSuccess methods to start the next server request. I think this will increase readability at least a bit.