All Questions
56 questions
0
votes
2
answers
105
views
How can a Callable return a value from a predefined void callback?
I am using a data-related API interface which has a key void callback function that is automatically invoked to mark the end of some IO operations. I want to make the class Callable<String> and ...
1
vote
1
answer
233
views
How to return a value retrieved inside a callback function's void overriden method?
I have the following function, which returns a long value. However, that long value (result.id.longValue()) is retrieved inside a callback's void overridden method, so I can't just return the ...
-1
votes
2
answers
794
views
How to make REST call asynchronous in Java
I have REST calls between two microservices, one of the call is taking more than 15 mins of time to complete. We have company's own private cloud implementation which is terminating any open ...
0
votes
1
answer
692
views
How to execute callback of async call on Java's main thread?
Is there a way to force the execution of the callback to be executed on the main thread?
For example, in the following code:
public static void main(String[] args) throws Exception {
...
0
votes
1
answer
387
views
Jersey InvocationCallback Completed: Which thread is used to invoke these methods
I am working on a Async Processing Module and Implemented Jersey Invocation Callback.
My implementation is straight forward and am defining a Completed and Failed methods as mentioned in
https://docs....
1
vote
1
answer
79
views
How to handle asynchronicity on Android Java?
I'm using OkHttp to send REST requests to the server, and the responses are returned asynchronously. Since Java is primarily a server-side language, the concept of handling asynchronous returns are ...
0
votes
1
answer
40
views
How can I listen for events in my activity waiting for a computation to finish?
I have a main activity which needs to listen for the results of computation on an audio stream so.
Here's the main activity
private void setSoundProcessListener() {
SoundProcess object = new ...
0
votes
1
answer
3k
views
java Catch exception inside a async callback
I have a callback which may throw a custom exception.
I'm trying to throw it, but it's not being catched on the outer scope, nor the compiler let me catch it, it says: "Exception is never thrown ...
1
vote
1
answer
340
views
Java/Firestore - Wait for data to be read before looping to next item (Async)
I am trying to implement a VMMV architecture on my project in order to have low coupling between objects.
I have 2 entities in my Firestore database: Offers and Users.
Each offer is posted by a user.
...
0
votes
0
answers
45
views
Callback Problems with Firebase and Android
I have a problem when I am fetching my Data from Firebase Firestore. I want to get multiple Documents out of my "Posts" collection and that works fine. But to get my user documents out of my "Users" ...
0
votes
1
answer
546
views
How do I get a data from a Retrofit onResponse
I want to get an ArrayList<ItemList> from my Retrofit Callback and save it in as a ArrayList variable in my class.
In other word I need to use data from retrofitList even when I leave the ...
0
votes
3
answers
35
views
Return value of interface method (no params) is acquired asynchronously. Can it be implemented?
I've been given an interface which is like this:
MyInterface {
List<FirebaseVisionFace> getFaceList();
}
I have to implement it in a class (let's call it MyFirebaseFaceClass) in such a way ...
0
votes
2
answers
2k
views
Async callback and listener
I have the following interfaces:
public interface NumberOfCellsListener {
public void numberOfCellsChanged(int patientId, int numOfCells);
}
public interface NumberOfCells {
public void ...
0
votes
0
answers
64
views
How to return the value of an asynchronous callback?
This is my code, it's a query to mysql for return 1 or 0, if exist a element in database. I want to know how I get the value?
private void comprobarUsuario(String url){
JsonArrayRequest ...
2
votes
0
answers
442
views
How to properly await the completion of multiple async calls from a swagger client in java?
I need to make multiple asynchronous calls through a Swagger generated client, and await the completion of all of the request before continuing. Ideally, I want the request to be made in parallel with ...